Commits

Benjamin Peterson committed 2966c9d

only close non-None files

  • Participants
  • Parent commits 94a7475
  • Branches 3.3

Comments (0)

Files changed (1)

Lib/test/test_imp.py

         # 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:])