mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
close open file from find_module()
This commit is contained in:
parent
1c87e2943a
commit
e048797991
1 changed files with 1 additions and 0 deletions
|
|
@ -128,6 +128,7 @@ class ImportTests(unittest.TestCase):
|
|||
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…
Add table
Add a link
Reference in a new issue