diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-18 18:40:54 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2002-06-18 18:40:54 (GMT) |
commit | c01b350d36b0f8a6f2f24157b65f71cf5b76c8a8 (patch) | |
tree | e2a564ca8e8dc2e0e6e886f8dd7bb9a58368c3d3 /Lib/distutils | |
parent | 83ccb4e011e635d976090bbb5b27926f8cee99da (diff) | |
download | cpython-c01b350d36b0f8a6f2f24157b65f71cf5b76c8a8.zip cpython-c01b350d36b0f8a6f2f24157b65f71cf5b76c8a8.tar.gz cpython-c01b350d36b0f8a6f2f24157b65f71cf5b76c8a8.tar.bz2 |
Only import msvccompiler on win32 platforms.
Diffstat (limited to 'Lib/distutils')
-rw-r--r-- | Lib/distutils/command/build_ext.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py index 943f30a..6b6f2c7 100644 --- a/Lib/distutils/command/build_ext.py +++ b/Lib/distutils/command/build_ext.py @@ -624,17 +624,17 @@ class build_ext (Command): # pyconfig.h that MSVC groks. The other Windows compilers all seem # to need it mentioned explicitly, though, so that's what we do. # Append '_d' to the python import library on debug builds. - from distutils.msvccompiler import MSVCCompiler - if sys.platform == "win32" and \ - not isinstance(self.compiler, MSVCCompiler): - template = "python%d%d" - if self.debug: - template = template + '_d' - pythonlib = (template % - (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) - # don't extend ext.libraries, it may be shared with other - # extensions, it is a reference to the original list - return ext.libraries + [pythonlib] + if sys.platform == "win32": + from distutils.msvccompiler import MSVCCompiler + if not isinstance(self.compiler, MSVCCompiler): + template = "python%d%d" + if self.debug: + template = template + '_d' + pythonlib = (template % + (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff)) + # don't extend ext.libraries, it may be shared with other + # extensions, it is a reference to the original list + return ext.libraries + [pythonlib] elif sys.platform == "os2emx": # EMX/GCC requires the python library explicitly, and I # believe VACPP does as well (though not confirmed) - AIM Apr01 |