summaryrefslogtreecommitdiff
path: root/modutils.py
diff options
context:
space:
mode:
authorsylvain thenault <sylvain.thenault@logilab.fr>2009-03-25 09:04:04 +0100
committersylvain thenault <sylvain.thenault@logilab.fr>2009-03-25 09:04:04 +0100
commit9fb2de74a6a6525a7025037b9178ed6952e293b1 (patch)
treeb06a92806ad630b33dfd7f9786b66d77ff87bd23 /modutils.py
parentd65252632774eb17f4f33c389854d4deb982f80f (diff)
downloadlogilab-common-9fb2de74a6a6525a7025037b9178ed6952e293b1.tar.gz
restore messages (make fail pylint tests...)
Diffstat (limited to 'modutils.py')
-rw-r--r--modutils.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/modutils.py b/modutils.py
index f4c55aa..6c67964 100644
--- a/modutils.py
+++ b/modutils.py
@@ -539,10 +539,10 @@ def _search_zip(modpath, pic):
if importer is not None:
if importer.find_module(modpath[0]):
if not importer.find_module('/'.join(modpath)):
- raise ImportError('No module %s in %s' % (
- '.'.join(modpath[1:]), file))
+ raise ImportError('No module named %s in %s/%s' % (
+ '.'.join(modpath[1:]), file, modpath))
return ZIPFILE, abspath(filepath) + '/' + '/'.join(modpath), filepath
- raise ImportError('No module %s' % '.'.join(modpath))
+ raise ImportError('No module named %s' % '.'.join(modpath))
def _module_file(modpath, path=None):
"""get a module type / file path
@@ -574,6 +574,7 @@ def _module_file(modpath, path=None):
checkeggs = True
except AttributeError:
checkeggs = False
+ imported = []
while modpath:
try:
_, mp_filename, mp_desc = find_module(modpath[0], path)
@@ -593,11 +594,12 @@ def _module_file(modpath, path=None):
except ImportError:
pass
checkeggs = False
- modpath.pop(0)
+ imported.append(modpath.pop(0))
mtype = mp_desc[2]
if modpath:
if mtype != PKG_DIRECTORY:
- raise ImportError('No module %r' % '.'.join(modpath))
+ raise ImportError('No module %s in %s' % ('.'.join(modpath),
+ '.'.join(imported)))
path = [mp_filename]
return mtype, mp_filename