diff options
Diffstat (limited to 'Lib/test/regrtest.py')
-rwxr-xr-x | Lib/test/regrtest.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index 34b743e..8b46f6e 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -859,9 +859,15 @@ class saved_test_environment: sys.path_hooks[:] = saved_hooks[2] def get___import__(self): - return __builtins__.__import__ + if isinstance(__builtins__, dict): + return __builtins__['__import__'] + else: + return __builtins__.__import__ def restore___import__(self, import_): - __builtins__.__import__ = import_ + if isinstance(__builtins__, dict): + __builtins__['__import__'] = import_ + else: + __builtins__.__import__ = import_ def get_warnings_filters(self): return id(warnings.filters), warnings.filters, warnings.filters[:] |