From: Stefan Behnel Date: Mon, 11 Apr 2011 21:26:54 +0000 (+0200) Subject: fix py-importing in pyximport X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3dd2aed3ef697170c3d5f4a139c15ea5d9277d46;p=cython.git fix py-importing in pyximport --- diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py index 430dfff2..c0e91f7d 100644 --- a/pyximport/pyximport.py +++ b/pyximport/pyximport.py @@ -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