Kaydet (Commit) 5379dea2 authored tarafından Tim Peters's avatar Tim Peters

SF bug 544733: Cygwin test_mmap fix for Python 2.2.1

Close a file before trying to unlink it, and apparently Cygwin needs
writes to an mmap'ed file to get flushed before they're visible.

Bugfix candidate, but I think only for the 2.2 line (it's testing
features that I think were new in 2.2).
üst 2b858971
...@@ -238,6 +238,7 @@ def test_both(): ...@@ -238,6 +238,7 @@ def test_both():
pass pass
else: else:
verify(0, "Incompatible parameters should raise ValueError.") verify(0, "Incompatible parameters should raise ValueError.")
f.close()
finally: finally:
try: try:
os.unlink(TESTFN) os.unlink(TESTFN)
...@@ -252,6 +253,7 @@ def test_both(): ...@@ -252,6 +253,7 @@ def test_both():
data = 'aabaac\x00deef\x00\x00aa\x00' data = 'aabaac\x00deef\x00\x00aa\x00'
n = len(data) n = len(data)
f.write(data) f.write(data)
f.flush()
m = mmap.mmap(f.fileno(), n) m = mmap.mmap(f.fileno(), n)
f.close() f.close()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment