mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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
This commit is contained in:
parent
1a5b9562d6
commit
ccd9e75b18
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue