1 Index: build_scripts.py
2 ===================================================================
3 --- a/Lib/distutils/command/build_scripts.py
4 +++ b/Lib/distutils/command/build_scripts.py
8 def copy_scripts (self):
9 - """Copy each script listed in 'self.scripts'; if it's marked as a
10 - Python script in the Unix way (first line matches 'first_line_re',
11 - ie. starts with "\#!" and contains "python"), then adjust the first
12 - line to refer to the current Python interpreter as we copy.
13 + """Copy each script listed in 'self.scripts'
15 self.mkpath(self.build_dir)
22 - first_line = f.readline()
24 - self.warn("%s is an empty file (skipping)" % script)
27 - match = first_line_re.match(first_line)
30 - post_interp = match.group(1) or ''
33 - log.info("copying and adjusting %s -> %s", script,
35 - if not self.dry_run:
36 - outf = open(outfile, "w")
37 - if not sysconfig.python_build:
38 - outf.write("#!%s%s\n" %
42 - outf.write("#!%s%s\n" %
44 - sysconfig.get_config_var("BINDIR"),
45 - "python%s%s" % (sysconfig.get_config_var("VERSION"),
46 - sysconfig.get_config_var("EXE"))),
48 - outf.writelines(f.readlines())
55 - self.copy_file(script, outfile)
58 + self.copy_file(script, outfile)
60 if os.name == 'posix':