summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-01-13 21:38:45 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-01-13 21:38:45 (GMT)
commitddc82ea944d330d517196b363620e0fed5426a16 (patch)
tree3c6411478b78eb23255b622428e5392a58f12ff5 /Lib
parent87fec22476ad0ef5d87398adfc00dd8b159015e3 (diff)
downloadcpython-ddc82ea944d330d517196b363620e0fed5426a16.zip
cpython-ddc82ea944d330d517196b363620e0fed5426a16.tar.gz
cpython-ddc82ea944d330d517196b363620e0fed5426a16.tar.bz2
A new test here was failing on Windows, because the test before it never
managed to delete the @test file it intended to delete. Also, I don't see a reason to create a 4MB file in the new test, so cut it back to 16K.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_mmap.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index 69d3cd5..a6796d5 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -290,31 +290,26 @@ def test_both():
slice = data[start : finish]
vereq(m.find(slice), data.find(slice))
vereq(m.find(slice + 'x'), -1)
+ m.close()
finally:
- try:
- os.unlink(TESTFN)
- except OSError:
- pass
+ os.unlink(TESTFN)
# make sure a double close doesn't crash on Solaris (Bug# 665913)
f = open(TESTFN, 'w+')
try: # unlink TESTFN no matter what
- f.write(2**24 * 'a') # Arbitrary character
+ f.write(2**16 * 'a') # Arbitrary character
f.close()
f = open(TESTFN)
- mf = mmap.mmap(f.fileno(), 2**24, access=mmap.ACCESS_READ)
+ mf = mmap.mmap(f.fileno(), 2**16, access=mmap.ACCESS_READ)
mf.close()
mf.close()
f.close()
finally:
- try:
- os.unlink(TESTFN)
- except OSError:
- pass
+ os.unlink(TESTFN)
print ' Test passed'