From 22dd487e90a22affe828d483e0698053b2866492 Mon Sep 17 00:00:00 2001 From: Sylvain Th?nault Date: Tue, 11 May 2010 16:15:05 +0200 Subject: is_standard_module fix --- modutils.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modutils.py') 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 -- cgit v1.2.1