diff options
author | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-05-11 16:15:05 +0200 |
---|---|---|
committer | Sylvain Th?nault <sylvain.thenault@logilab.fr> | 2010-05-11 16:15:05 +0200 |
commit | 22dd487e90a22affe828d483e0698053b2866492 (patch) | |
tree | 9793899c520dedc501ff47f31a1f9dcd27051050 | |
parent | f608ab9ae0dd93cfcfd8efc6d5d401959ed12880 (diff) | |
download | logilab-common-22dd487e90a22affe828d483e0698053b2866492.tar.gz |
is_standard_module fix
-rw-r--r-- | modutils.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modutils.py b/modutils.py index 0e4ddc1..e71e172 100644 --- a/modutils.py +++ b/modutils.py @@ -498,11 +498,10 @@ def is_standard_module(modname, std_path=(STD_LIB_DIR,)): - is located on the path listed in one of the directory in `std_path` - is a built-in module """ - modpath = modname.split('.') - modname = modpath[0] + modname = modname.split('.')[0] try: - filename = file_from_modpath(modpath) - except ImportError: + filename = file_from_modpath([modname]) + except ImportError, ex: # import failed, i'm probably not so wrong by supposing it's # not standard... return 0 |