fix py-importing in pyximport
authorStefan Behnel <scoder@users.berlios.de>
Mon, 11 Apr 2011 21:26:54 +0000 (23:26 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 11 Apr 2011 21:26:54 +0000 (23:26 +0200)
pyximport/pyximport.py

index 430dfff26dd0d3163a541d9de03a1c74067908fa..c0e91f7d46bd5bd80c11e239937c371d0cd2e94a 100644 (file)
@@ -205,7 +205,10 @@ class PyxImporter(object):
         try:
             fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)
             if fp: fp.close()  # Python should offer a Default-Loader to avoid this double find/open!
-            if ty!=imp.C_EXTENSION: # only when an extension, check if we have a .pyx next!
+            if pathname.endswith(self.extension):
+                return PyxLoader(fullname, pathname,
+                                 pyxbuild_dir=self.pyxbuild_dir)
+            if ty != imp.C_EXTENSION: # only when an extension, check if we have a .pyx next!
                 return None
 
             # find .pyx fast, when .so/.pyd exist --inplace