]> granicus.if.org Git - python/commitdiff
A new test here was failing on Windows, because the test before it never
authorTim Peters <tim.peters@gmail.com>
Mon, 13 Jan 2003 21:38:45 +0000 (21:38 +0000)
committerTim Peters <tim.peters@gmail.com>
Mon, 13 Jan 2003 21:38:45 +0000 (21:38 +0000)
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.

Lib/test/test_mmap.py

index 69d3cd5311f544165837907ee818b78c022d9ff2..a6796d5279adbf898e96cdfd1a1040a64cbf9e6d 100644 (file)
@@ -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'