Commit e0487979 authored by Benjamin Peterson's avatar Benjamin Peterson

close open file from find_module()

parent 1c87e294
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment