From: Andrew M. Kuchling Date: Wed, 28 Feb 2001 20:59:33 +0000 (+0000) Subject: Leave #! lines featuring /usr/bin/env alone X-Git-Tag: v2.1b1~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a95850323734c5d16c31f1d523b29c5f4f75ff9;p=python Leave #! lines featuring /usr/bin/env alone --- diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index 495f4c372a..1f68899ce9 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -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):