summaryrefslogtreecommitdiff
path: root/pyximport
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2012-08-06 15:51:17 +0200
committerStefan Behnel <stefan_ml@behnel.de>2012-08-06 15:51:17 +0200
commit2b17a4acae7bf53aa37deec1ce447e284ddf33c9 (patch)
treeac420942171c6dfdefaac088229ac61bc7993676 /pyximport
parent2000b13b2003fc45c6ab7985dc8dacb946b11ad4 (diff)
downloadcython-2b17a4acae7bf53aa37deec1ce447e284ddf33c9.tar.gz
fix some glitches in last pyximport changes
Diffstat (limited to 'pyximport')
-rw-r--r--pyximport/pyxbuild.py4
-rw-r--r--pyximport/pyximport.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/pyximport/pyxbuild.py b/pyximport/pyxbuild.py
index 02e733165..3218f6d22 100644
--- a/pyximport/pyxbuild.py
+++ b/pyximport/pyxbuild.py
@@ -27,7 +27,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
or .dll ."""
assert os.path.exists(filename), "Could not find %s" % os.path.abspath(filename)
- path, name = os.path.split(filename)
+ path, name = os.path.split(os.path.abspath(filename))
if not ext:
modname, extension = os.path.splitext(name)
@@ -40,7 +40,7 @@ def pyx_to_dll(filename, ext = None, force_rebuild = 0,
pyxbuild_dir = os.path.join(path, "_pyxbld")
package_base_dir = path
- for package_name in ext.name.split('.')[1::-1]:
+ for package_name in ext.name.split('.')[-2::-1]:
package_base_dir, pname = os.path.split(package_base_dir)
if pname != package_name:
# something is wrong - package path doesn't match file path
diff --git a/pyximport/pyximport.py b/pyximport/pyximport.py
index 8e3dc59fd..43814e15b 100644
--- a/pyximport/pyximport.py
+++ b/pyximport/pyximport.py
@@ -205,7 +205,7 @@ def load_module(name, pyxfilename, pyxbuild_dir=None, is_package=False,
inplace=build_inplace, language_level=language_level)
mod = imp.load_dynamic(name, so_path)
if is_package and not hasattr(mod, '__path__'):
- mod.__path__ = os.path.dirname(so_path)
+ mod.__path__ = [os.path.dirname(so_path)]
assert mod.__file__ == so_path, (mod.__file__, so_path)
except Exception:
if pyxargs.load_py_module_on_import_failure and pyxfilename.endswith('.py'):
@@ -381,6 +381,7 @@ class LibLoader(object):
source_path, so_path, is_package = self._libs[fullname]
except KeyError:
raise ValueError("invalid module %s" % fullname)
+ _debug("Loading shared library module '%s' from %s", fullname, so_path)
return load_module(fullname, source_path, so_path=so_path, is_package=is_package)
def add_lib(self, fullname, path, so_path, is_package):