From: Benjamin Peterson Date: Sat, 11 May 2013 21:29:03 +0000 (-0500) Subject: only close non-None files X-Git-Tag: v3.3.2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aa6f688bd4f02b5d50c26cf649172672c1546d12;p=thirdparty%2FPython%2Fcpython.git only close non-None files --- diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 96771d8ba532..fe436f398501 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -241,7 +241,8 @@ class ImportTests(unittest.TestCase): # Issue #15902 name = '_heapq' found = imp.find_module(name) - found[0].close() + if found[0] is not None: + found[0].close() if found[2][2] != imp.C_EXTENSION: return imp.load_module(name, None, *found[1:])