Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit db10db9

Browse filesBrowse files
refacktargos
authored andcommitted
build: move meta-shebang back to configure
PR-URL: #22450 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent db52f8f commit db10db9
Copy full SHA for db10db9

File tree

Expand file treeCollapse file tree

2 files changed

+29
-26
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+29
-26
lines changed
Open diff view settings
Collapse file

‎configure‎

Copy file name to clipboard
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/sh
2+
3+
# Locate python2 interpreter and re-execute the script. Note that the
4+
# mix of single and double quotes is intentional, as is the fact that
5+
# the ] goes on a new line.
6+
_=[ 'exec' '/bin/sh' '-c' '''
7+
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
8+
which python2 >/dev/null && exec python2 "$0" "$@"
9+
exec python "$0" "$@"
10+
''' "$0" "$@"
11+
]
12+
del _
13+
14+
import sys
15+
from distutils.spawn import find_executable as which
16+
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
17+
sys.stderr.write('Please use either Python 2.6 or 2.7')
18+
19+
python2 = which('python2') or which('python2.6') or which('python2.7')
20+
21+
if python2:
22+
sys.stderr.write(':\n\n')
23+
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
24+
25+
sys.stderr.write('\n')
26+
sys.exit(1)
27+
28+
import configure
Collapse file

‎configure.py‎

Copy file name to clipboardExpand all lines: configure.py
+1-26Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,4 @@
1-
#!/bin/sh
2-
3-
# Locate python2 interpreter and re-execute the script. Note that the
4-
# mix of single and double quotes is intentional, as is the fact that
5-
# the ] goes on a new line.
6-
_=[ 'exec' '/bin/sh' '-c' '''
7-
which python2.7 >/dev/null && exec python2.7 "$0" "$@"
8-
which python2 >/dev/null && exec python2 "$0" "$@"
9-
exec python "$0" "$@"
10-
''' "$0" "$@"
11-
]
12-
del _
13-
141
import sys
15-
from distutils.spawn import find_executable as which
16-
if sys.version_info[0] != 2 or sys.version_info[1] not in (6, 7):
17-
sys.stderr.write('Please use either Python 2.6 or 2.7')
18-
19-
python2 = which('python2') or which('python2.6') or which('python2.7')
20-
21-
if python2:
22-
sys.stderr.write(':\n\n')
23-
sys.stderr.write(' ' + python2 + ' ' + ' '.join(sys.argv))
24-
25-
sys.stderr.write('\n')
26-
sys.exit(1)
27-
282
import errno
293
import optparse
304
import os
@@ -35,6 +9,7 @@
359
import subprocess
3610
import shutil
3711
import string
12+
from distutils.spawn import find_executable as which
3813

3914
# If not run from node/, cd to node/.
4015
os.chdir(os.path.dirname(__file__) or '.')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.