mirror of
https://github.com/python/cpython
synced 2024-10-04 23:21:40 +00:00
close open file from find_module()
This commit is contained in:
parent
1c87e2943a
commit
e048797991
|
@ -128,6 +128,7 @@ def test_imp_module(self):
|
|||
orig_getenv = os.getenv
|
||||
with EnvironmentVarGuard():
|
||||
x = imp.find_module("os")
|
||||
self.addCleanup(x[0].close)
|
||||
new_os = imp.load_module("os", *x)
|
||||
self.assertIs(os, new_os)
|
||||
self.assertIs(orig_path, new_os.path)
|
||||
|
|
Loading…
Reference in a new issue