]> granicus.if.org Git - python/commitdiff
Fix bug 3375 - _multiprocessing.so build problems on OS X.
authorGuido van Rossum <guido@python.org>
Thu, 17 Jul 2008 16:23:53 +0000 (16:23 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 17 Jul 2008 16:23:53 +0000 (16:23 +0000)
The solution is to clear sys.path_importer_cache.

setup.py

index 90fe68f4475b18992e44cb4741cf08a048551854..f0fed72b8cb1293ebb3c5fc3420fc17f740d2932 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -263,6 +263,12 @@ class PyBuildExt(build_ext):
         ext_filename = os.path.join(
             self.build_lib,
             self.get_ext_filename(self.get_ext_fullname(ext.name)))
+
+        # If the build directory didn't exist when setup.py was
+        # started, sys.path_importer_cache has a negative result
+        # cached.  Clear that cache before trying to import.
+        sys.path_importer_cache.clear()
+
         try:
             imp.load_dynamic(ext.name, ext_filename)
         except ImportError as why: