diff options
author | Greg Ward <gward@python.net> | 2001-07-25 20:20:11 +0000 |
---|---|---|
committer | Greg Ward <gward@python.net> | 2001-07-25 20:20:11 +0000 |
commit | ebc85cd3bef575e72475d8e250f014c3e8e3f0f6 (patch) | |
tree | 36e419cea910f2e58147997474bbdd4f09683f77 /Lib | |
parent | f40d5863780c701d9f02653d6bd2fb27fa2d1e72 (diff) | |
download | cpython-ebc85cd3bef575e72475d8e250f014c3e8e3f0f6.tar.gz |
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
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/distutils/command/build_scripts.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index ee7f4e2d1e..653b8d8ace 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -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): |