mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
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
This commit is contained in:
parent
e628a2fa85
commit
7cf7e7e529
1 changed files with 2 additions and 4 deletions
|
@ -10,10 +10,8 @@ import sys, os, re
|
|||
from distutils.core import Command
|
||||
from distutils.dep_util import newer
|
||||
|
||||
# check if Python is called on the first line with this expression.
|
||||
# This expression will leave lines using /usr/bin/env alone; presumably
|
||||
# the script author knew what they were doing...)
|
||||
first_line_re = re.compile(r'^#!(?!\s*/usr/bin/env\b).*python(\s+.*)?')
|
||||
# check if Python is called on the first line with this expression
|
||||
first_line_re = re.compile(r'^#!.*python(\s+.*)?')
|
||||
|
||||
class build_scripts (Command):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue