Commit efb0837d authored by Stefan Behnel's avatar Stefan Behnel

safety fix in pxyimport

parent 89ebc32d
...@@ -205,7 +205,7 @@ class PyxImporter(object): ...@@ -205,7 +205,7 @@ 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 pathname.endswith(self.extension): if pathname and pathname.endswith(self.extension):
return PyxLoader(fullname, pathname, return PyxLoader(fullname, pathname,
pyxbuild_dir=self.pyxbuild_dir) pyxbuild_dir=self.pyxbuild_dir)
if ty != imp.C_EXTENSION: # only when an extension, check if we have a .pyx next! if ty != imp.C_EXTENSION: # only when an extension, check if we have a .pyx next!
......
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