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).
This commit is contained in:
Tim Peters 2002-04-18 04:30:18 +00:00
parent 2b85897189
commit 5379dea2a7
1 changed files with 2 additions and 0 deletions

View File

@ -238,6 +238,7 @@ def test_both():
pass
else:
verify(0, "Incompatible parameters should raise ValueError.")
f.close()
finally:
try:
os.unlink(TESTFN)
@ -252,6 +253,7 @@ def test_both():
data = 'aabaac\x00deef\x00\x00aa\x00'
n = len(data)
f.write(data)
f.flush()
m = mmap.mmap(f.fileno(), n)
f.close()