summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_import.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2010-10-30 23:06:57 (GMT)
committerBenjamin Peterson <benjamin@python.org>2010-10-30 23:06:57 (GMT)
commite048797991d4ea568c4d3eacf37cc2c3f0f5a344 (patch)
treecc7c566126238a77f3b978762924cd6410afe527 /Lib/test/test_import.py
parent1c87e2943af7eac9971183734fc07190a1a65d65 (diff)
downloadcpython-e048797991d4ea568c4d3eacf37cc2c3f0f5a344.zip
cpython-e048797991d4ea568c4d3eacf37cc2c3f0f5a344.tar.gz
cpython-e048797991d4ea568c4d3eacf37cc2c3f0f5a344.tar.bz2
close open file from find_module()
Diffstat (limited to 'Lib/test/test_import.py')
-rw-r--r--Lib/test/test_import.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_import.py b/Lib/test/test_import.py
index 10b32d3..02f56e6 100644
--- a/Lib/test/test_import.py
+++ b/Lib/test/test_import.py
@@ -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)