diff options
-rw-r--r-- | Lib/test/test_imp.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 96771d8..fe436f3 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:]) |