[Python-checkins] cpython (3.1): Fix potential resource leak in test_mmap.

nadeem.vawda python-checkins at python.org
Sat May 7 14:38:19 CEST 2011


http://hg.python.org/cpython/rev/c32b3aceeb84
changeset:   69899:c32b3aceeb84
branch:      3.1
parent:      69895:b112c72f8c01
user:        Nadeem Vawda <nadeem.vawda at gmail.com>
date:        Sat May 07 14:35:05 2011 +0200
summary:
  Fix potential resource leak in test_mmap.

files:
  Lib/test/test_mmap.py |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -664,6 +664,7 @@
             f.write(tail)
             f.flush()
         except (IOError, OverflowError):
+            f.close()
             raise unittest.SkipTest("filesystem does not have largefile support")
         return f
 

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


More information about the Python-checkins mailing list