summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2002-09-11 02:56:42 (GMT)
committerBarry Warsaw <barry@python.org>2002-09-11 02:56:42 (GMT)
commitccd9e75b189c8084b08af797c5711938685b8b5b (patch)
tree208c38404f0d729ed75e13f496d9333296b5731b
parent1a5b9562d62be4fac4bea7b604f4d921f284a817 (diff)
downloadcpython-ccd9e75b189c8084b08af797c5711938685b8b5b.zip
cpython-ccd9e75b189c8084b08af797c5711938685b8b5b.tar.gz
cpython-ccd9e75b189c8084b08af797c5711938685b8b5b.tar.bz2
test_both(): I believe this was a typo: m is only defined if no
exception occurred so it should only be closed in the else clause. Without this change we can an UnboundLocalError on Linux: Traceback (most recent call last): File "Lib/test/test_mmap.py", line 304, in ? test_both() File "Lib/test/test_mmap.py", line 208, in test_both m.close() UnboundLocalError: local variable 'm' referenced before assignment
-rw-r--r--Lib/test/test_mmap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index ea9c4ee..417080f 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -205,7 +205,7 @@ def test_both():
# we expect a ValueError on Unix, but not on Windows
if not sys.platform.startswith('win'):
verify(0, "Opening mmap with size+1 should raise ValueError.")
- m.close()
+ m.close()
f.close()
if sys.platform.startswith('win'):
# Repair damage from the resizing test.