From: Thomas Heller Date: Mon, 12 Feb 2001 09:17:06 +0000 (+0000) Subject: This change makes imputil more closely emulate the standard import X-Git-Tag: v2.1b1~403 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfae1964c8973a78f332d2d3f224eb78748981db;p=python This change makes imputil more closely emulate the standard import mechanism to support self-modifying modules. --- diff --git a/Lib/imputil.py b/Lib/imputil.py index 3185d7d94c..2f87d69be9 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.