Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7cf7e7e

Browse files
committed
Undo revision 1.7: always mangle a #! line containing "python" to point
to the current Python interpreter (ie. the one used for building/installation), even (especially!) if "/usr/bin/env" appears in the #! line. Rationale: installing scripts with "#!/usr/bin/env python" is asking for trouble, because 1) it might pick the wrong interpreter (not the one used to build/install the script) 2) it doesn't work on all platforms (try it on IRIX 5, or on Linux with command-line options for python) 3) "env" might not be in /usr/bin
1 parent e628a2f commit 7cf7e7e

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

Lib/distutils/command/build_scripts.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
from distutils.core import Command
1111
from distutils.dep_util import newer
1212

13-
# check if Python is called on the first line with this expression.
14-
# This expression will leave lines using /usr/bin/env alone; presumably
15-
# the script author knew what they were doing...)
16-
first_line_re = re.compile(r'^#!(?!\s*/usr/bin/env\b).*python(\s+.*)?')
13+
# check if Python is called on the first line with this expression
14+
first_line_re = re.compile(r'^#!.*python(\s+.*)?')
1715

1816
class build_scripts (Command):
1917

0 commit comments

Comments
 (0)