Commit ddc82ea9 authored by Tim Peters's avatar Tim Peters

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.
parent 87fec224
...@@ -290,31 +290,26 @@ def test_both(): ...@@ -290,31 +290,26 @@ def test_both():
slice = data[start : finish] slice = data[start : finish]
vereq(m.find(slice), data.find(slice)) vereq(m.find(slice), data.find(slice))
vereq(m.find(slice + 'x'), -1) vereq(m.find(slice + 'x'), -1)
m.close()
finally: finally:
try: os.unlink(TESTFN)
os.unlink(TESTFN)
except OSError:
pass
# make sure a double close doesn't crash on Solaris (Bug# 665913) # make sure a double close doesn't crash on Solaris (Bug# 665913)
f = open(TESTFN, 'w+') f = open(TESTFN, 'w+')
try: # unlink TESTFN no matter what try: # unlink TESTFN no matter what
f.write(2**24 * 'a') # Arbitrary character f.write(2**16 * 'a') # Arbitrary character
f.close() f.close()
f = open(TESTFN) 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()
mf.close() mf.close()
f.close() f.close()
finally: finally:
try: os.unlink(TESTFN)
os.unlink(TESTFN)
except OSError:
pass
print ' Test passed' print ' Test passed'
......
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