summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Douard <david.douard@logilab.fr>2012-07-30 12:18:33 +0200
committerDavid Douard <david.douard@logilab.fr>2012-07-30 12:18:33 +0200
commit507c60ba25e29654ec1a6245d684fb0d96dd12b5 (patch)
tree417b0ed44105e8757691df2a83500c5a9bdb75a9
parent8208841291db5f837786a16c845e5f3495e7eac8 (diff)
downloadlogilab-common-507c60ba25e29654ec1a6245d684fb0d96dd12b5.tar.gz
[modutils] Fix modutils.modpath_from_file (closes #100757)
-rw-r--r--modutils.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/modutils.py b/modutils.py
index 8b75415..2aa4ce3 100644
--- a/modutils.py
+++ b/modutils.py
@@ -237,9 +237,7 @@ def modpath_from_file(filename, extrapath=None):
return extrapath[path_].split('.') + submodpath
for path in sys.path:
path = abspath(path)
- if path and base[:len(path)] == path:
- if path.startswith(EXT_LIB_DIR):
- continue
+ if path and base.startswith(path):
modpath = [pkg for pkg in base[len(path):].split(os.sep) if pkg]
if _check_init(path, modpath[:-1]):
return modpath