]> granicus.if.org Git - python/commitdiff
Only import msvccompiler on win32 platforms.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 18 Jun 2002 18:40:54 +0000 (18:40 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 18 Jun 2002 18:40:54 +0000 (18:40 +0000)
Lib/distutils/command/build_ext.py

index 943f30a4fb330b4a4c957e2ac021c68640d671ec..6b6f2c7d5740d7ec884b8fa4c065921ab79b013c 100644 (file)
@@ -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