]> granicus.if.org Git - python/commitdiff
Leave #! lines featuring /usr/bin/env alone
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 28 Feb 2001 20:59:33 +0000 (20:59 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 28 Feb 2001 20:59:33 +0000 (20:59 +0000)
Lib/distutils/command/build_scripts.py

index 495f4c372ab8c19d634f0d030b2cf89467486dfb..1f68899ce95ddca4c6684675008790e2a81167ee 100644 (file)
@@ -10,8 +10,10 @@ 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
-first_line_re = re.compile(r'^#!.*python(\s+.*)?')
+# 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+.*)?')
 
 class build_scripts (Command):