Commit 3dd2aed3 authored by Stefan Behnel's avatar Stefan Behnel

fix py-importing in pyximport

parent ed3fbb05
...@@ -205,7 +205,10 @@ class PyxImporter(object): ...@@ -205,7 +205,10 @@ class PyxImporter(object):
try: try:
fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path) 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 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 return None
# find .pyx fast, when .so/.pyd exist --inplace # find .pyx fast, when .so/.pyd exist --inplace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment