From e048797991d4ea568c4d3eacf37cc2c3f0f5a344 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Sat, 30 Oct 2010 23:06:57 +0000 Subject: close open file from find_module() --- Lib/test/test_import.py | 1 + 1 file changed, 1 insertion(+) 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) -- cgit v0.12