From bfae1964c8973a78f332d2d3f224eb78748981db Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Mon, 12 Feb 2001 09:17:06 +0000 Subject: This change makes imputil more closely emulate the standard import mechanism to support self-modifying modules. --- Lib/imputil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/imputil.py b/Lib/imputil.py index 3185d7d..2f87d69 100644 --- a/Lib/imputil.py +++ b/Lib/imputil.py @@ -282,7 +282,8 @@ class Importer: if not is_module: exec code in module.__dict__ - return module + # fetch from sys.modules instead of returning module directly. + return sys.modules[fqname] def _load_tail(self, m, parts): """Import the rest of the modules, down from the top-level module. -- cgit v0.12