]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: import_hook.py was too strict in ensure_list (ImportError raised)
authorcaremoli <caremoli>
Wed, 9 Feb 2011 17:07:29 +0000 (17:07 +0000)
committercaremoli <caremoli>
Wed, 9 Feb 2011 17:07:29 +0000 (17:07 +0000)
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

index d812d8f67943243a763c553fa56ef3635ce6fd22..fcbdb1602bf22f926c2579f0cb451126c3730260 100755 (executable)
@@ -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):