diff options
| author | tarek <devnull@localhost> | 2010-02-22 00:03:35 -0500 |
|---|---|---|
| committer | tarek <devnull@localhost> | 2010-02-22 00:03:35 -0500 |
| commit | 70d21132738630877ca36f45d48c78fb69160fa3 (patch) | |
| tree | 37d5694d7b7260b47a900791690c3fefa253973c /src/distutils2/command/build_scripts.py | |
| parent | 9afb263036afa5b38d15591448b5ed7c49162e82 (diff) | |
| download | disutils2-70d21132738630877ca36f45d48c78fb69160fa3.tar.gz | |
refactored sysconfig and other backported modules
Diffstat (limited to 'src/distutils2/command/build_scripts.py')
| -rw-r--r-- | src/distutils2/command/build_scripts.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/distutils2/command/build_scripts.py b/src/distutils2/command/build_scripts.py index aae0cb9..7a95827 100644 --- a/src/distutils2/command/build_scripts.py +++ b/src/distutils2/command/build_scripts.py @@ -10,6 +10,10 @@ from distutils2.core import Command from distutils2.dep_util import newer from distutils2.util import convert_path from distutils2 import log +try: + import sysconfig +except ImportError: + from distutils2._backport import sysconfig # check if Python is called on the first line with this expression first_line_re = re.compile('^#!.*python[0-9.]*([ \t].*)?$') @@ -56,7 +60,6 @@ class build_scripts (Command): ie. starts with "\#!" and contains "python"), then adjust the first line to refer to the current Python interpreter as we copy. """ - _sysconfig = __import__('sysconfig') self.mkpath(self.build_dir) outfiles = [] for script in self.scripts: @@ -94,16 +97,16 @@ class build_scripts (Command): self.build_dir) if not self.dry_run: outf = open(outfile, "w") - if not _sysconfig.is_python_build(): + if not sysconfig.is_python_build(): outf.write("#!%s%s\n" % (self.executable, post_interp)) else: outf.write("#!%s%s\n" % (os.path.join( - _sysconfig.get_config_var("BINDIR"), - "python%s%s" % (_sysconfig.get_config_var("VERSION"), - _sysconfig.get_config_var("EXE"))), + sysconfig.get_config_var("BINDIR"), + "python%s%s" % (sysconfig.get_config_var("VERSION"), + sysconfig.get_config_var("EXE"))), post_interp)) outf.writelines(f.readlines()) outf.close() |
