Commit 642654c9 authored by Stefan Behnel's avatar Stefan Behnel

Provide better debug output if a pyximport fails.

parent 540a74f7
......@@ -217,7 +217,8 @@ def load_module(name, pyxfilename, pyxbuild_dir=None, is_package=False,
if is_package and not hasattr(mod, '__path__'):
mod.__path__ = [os.path.dirname(so_path)]
assert mod.__file__ == so_path, (mod.__file__, so_path)
except Exception:
except Exception as failure_exc:
_debug("Failed to load extension module: %r" % failure_exc)
if pyxargs.load_py_module_on_import_failure and pyxfilename.endswith('.py'):
# try to fall back to normal import
mod = imp.load_source(name, pyxfilename)
......
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