Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82c1c78 commit d340543Copy full SHA for d340543
1 file changed
Lib/test/test_importlib/import_/test_path.py
@@ -98,13 +98,18 @@ def test_None_on_sys_path(self):
98
new_path_hooks = [zipimport.zipimporter,
99
_bootstrap.FileFinder.path_hook(
100
*_bootstrap._get_supported_file_loaders())]
101
- with util.uncache('email'):
+ missing = object()
102
+ email = sys.modules.pop('email', missing)
103
+ try:
104
with util.import_state(meta_path=sys.meta_path[:],
105
path=new_path,
106
path_importer_cache=new_path_importer_cache,
107
path_hooks=new_path_hooks):
108
module = import_module('email')
109
self.assertIsInstance(module, ModuleType)
110
+ finally:
111
+ if email is not missing:
112
+ sys.modules['email'] = email
113
114
115
def test_main():
0 commit comments