Commit 9179ad4c authored by Steinn Steinsen's avatar Steinn Steinsen

fix import of pyx modules when '' is in sys.path

If '' is in sys.path and a module is found the package_path
is relative and breaks the build process.

--HG--
extra : transplant_source : 9%EA%CC%A6%3D%1B9R%EF%0DmM%CFZ%18%F3%EC%06%3B%B7
parent 16bb65dc
......@@ -291,17 +291,21 @@ class PyxImporter(object):
paths = sys.path
join_path = os.path.join
is_file = os.path.isfile
is_abs = os.path.isabs
abspath = os.path.abspath
#is_dir = os.path.isdir
sep = os.path.sep
for path in paths:
if not path:
path = os.getcwd()
elif not is_abs(path):
path = abspath(path)
if is_file(path+sep+pyx_module_name):
return PyxLoader(fullname, join_path(path, pyx_module_name),
pyxbuild_dir=self.pyxbuild_dir,
inplace=self.inplace,
language_level=self.language_level)
# not found, normal package, not a .pyx file, none of our business
_debug("%s not found" % fullname)
return None
......
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