From: prascle Date: Mon, 23 Oct 2006 07:46:01 +0000 (+0000) Subject: PR: bug PAL 13665 and EDF 311 X-Git-Tag: V3_2_3pre1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=910e629ec767d0cca83e270b00b1529acbcc826d;p=modules%2Fkernel.git PR: bug PAL 13665 and EDF 311 --- diff --git a/src/KERNEL_PY/import_hook.py b/src/KERNEL_PY/import_hook.py index 904e3d441..e3e744a81 100755 --- a/src/KERNEL_PY/import_hook.py +++ b/src/KERNEL_PY/import_hook.py @@ -149,7 +149,12 @@ def import_hook(name, globals=None, locals=None, fromlist=None): #when fromlist is not specified and name is a dotted name, # module is the root package not the real module #so we need to retrieve it - m=get_real_module(module,name) + # note: some modules like xml.dom do not play the rule + # (import xml: no attribute dom, but import xml.dom OK) + try: + m=get_real_module(module,name) + except AttributeError: + m=None if type(m) == type(sys) and is_shared(m.__name__): set_shared_imported(m.__name__,m)