From cbeb1b9ad4789b0fe4ea7f8efcaf98f7f8fec2f6 Mon Sep 17 00:00:00 2001 From: caremoli Date: Wed, 9 Feb 2011 17:07:29 +0000 Subject: [PATCH] CCAR: import_hook.py was too strict in ensure_list (ImportError raised) numpy.test() (1.5.1) fails in embedded console Now if the subelement does not exist, it is ignored --- src/KERNEL_PY/import_hook.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KERNEL_PY/import_hook.py b/src/KERNEL_PY/import_hook.py index d812d8f67..fcbdb1602 100755 --- a/src/KERNEL_PY/import_hook.py +++ b/src/KERNEL_PY/import_hook.py @@ -160,9 +160,9 @@ def ensure_fromlist(m, fromlist, recursive=0): else: subname="%s.%s" % (m.__name__, sub) submod = import_module(sub, subname, m) - if not submod: - raise ImportError, "No module named " + subname - l.append((subname,submod)) + #if not found ignore it + if submod: + l.append((subname,submod)) return l def import_hook(name, globals=None, locals=None, fromlist=None, *args, **kwds): -- 2.39.2