]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
*cough* repair utterly broken stuff from my last check-in (to do with
authorMichael W. Hudson <mwh@python.net>
Tue, 24 Dec 2002 14:45:54 +0000 (14:45 +0000)
committerMichael W. Hudson <mwh@python.net>
Tue, 24 Dec 2002 14:45:54 +0000 (14:45 +0000)
renaming rather than deleting modules that don't import).

setup.py

index 25b30e4f8e8eb95497a18e109bf59154adbbe96e..be0988117c242ffb3d7aec4292ca6c9ea5a6db54 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
 
 __version__ = "$Revision$"
 
-import sys, os, getopt
+import sys, os, getopt, imp
 from distutils import sysconfig
 from distutils import text_file
 from distutils.errors import *
@@ -161,9 +161,12 @@ class PyBuildExt(build_ext):
                 'WARNING: skipping import check for Carbon-based "%s"' %
                 ext.name)
             return
+        ext_filename = os.path.join(
+            self.build_lib,
+            self.get_ext_filename(self.get_ext_fullname(ext.name)))
         try:
-            __import__(ext.name)
-        except ImportError:
+                        imp.load_dynamic(ext.name, ext_filename)
+        except ImportError, why:
             if 1:
                 self.announce('*** WARNING: renaming "%s" since importing it'
                               ' failed: %s' % (ext.name, why))