[Python-checkins] cpython (3.3): only close non-None files

benjamin.peterson python-checkins at python.org
Sat May 11 23:29:24 CEST 2013


http://hg.python.org/cpython/rev/2966c9dbace9
changeset:   83719:2966c9dbace9
branch:      3.3
parent:      83712:94a7475d3a5f
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat May 11 16:29:03 2013 -0500
summary:
  only close non-None files

files:
  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
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -241,7 +241,8 @@
         # 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:])

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list