# HG changeset patch
# User David Douard <david.douard@logilab.fr>
# Date 1343643513 -7200
# Mon Jul 30 12:18:33 2012 +0200
# Branch stable
# Node ID d7f5380c5d235dbc74e3109bf7ad9a99ef5befbb
# Parent 8724116a446a9d20cd7a98e41bba6a84017e01ac
[modutils] Fix modutils.modpath_from_file (closes #100757)
# User David Douard <david.douard@logilab.fr>
# Date 1343643513 -7200
# Mon Jul 30 12:18:33 2012 +0200
# Branch stable
# Node ID d7f5380c5d235dbc74e3109bf7ad9a99ef5befbb
# Parent 8724116a446a9d20cd7a98e41bba6a84017e01ac
[modutils] Fix modutils.modpath_from_file (closes #100757)
@@ -235,13 +235,11 @@
1 if pkg] 2 if _check_init(path, submodpath[:-1]): 3 return extrapath[path_].split('.') + submodpath 4 for path in sys.path: 5 path = abspath(path) 6 - if path and base[:len(path)] == path: 7 - if path.startswith(EXT_LIB_DIR): 8 - continue 9 + if path and base.startswith(path): 10 modpath = [pkg for pkg in base[len(path):].split(os.sep) if pkg] 11 if _check_init(path, modpath[:-1]): 12 return modpath 13 raise ImportError('Unable to find module for %s in %s' % ( 14 filename, ', \n'.join(sys.path)))