diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index f61ad37d03c..8de9cd3f6d9 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -15,7 +15,7 @@ from distutils import log # check if Python is called on the first line with this expression -first_line_re = re.compile(r'^#!.*python[0-9.]*(\s+.*)?$') +first_line_re = re.compile('^#!.*python[0-9.]*([ \t].*)?$') class build_scripts (Command): @@ -96,7 +96,7 @@ def copy_scripts (self): (os.path.normpath(sys.executable), post_interp)) else: - outf.write("#!%s%s" % + outf.write("#!%s%s\n" % (os.path.join( sysconfig.get_config_var("BINDIR"), "python" + sysconfig.get_config_var("EXE")),