From 910e629ec767d0cca83e270b00b1529acbcc826d Mon Sep 17 00:00:00 2001 From: prascle Date: Mon, 23 Oct 2006 07:46:01 +0000 Subject: [PATCH] PR: bug PAL 13665 and EDF 311 --- src/KERNEL_PY/import_hook.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- 2.39.2