From 3dd2aed3ef697170c3d5f4a139c15ea5d9277d46 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 11 Apr 2011 23:26:54 +0200 Subject: [PATCH] fix py-importing in pyximport --- pyximport/pyximport.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- 2.26.2