Commit 09033068 authored by Hirokazu Yamamoto's avatar Hirokazu Yamamoto

mmap.resize for anonymous map is not working yet, so changed to real file mapping...

parent 264fc12f
...@@ -535,9 +535,12 @@ class MmapTests(unittest.TestCase): ...@@ -535,9 +535,12 @@ class MmapTests(unittest.TestCase):
m.close() m.close()
# Should not crash (Issue 5385) # Should not crash (Issue 5385)
m = mmap.mmap(-1, 1000) open(TESTFN, "wb").write("x"*10)
f = open(TESTFN, "r+b")
m = mmap.mmap(f.fileno(), 0)
f.close()
try: try:
m.resize(0) m.resize(0) # will raise WindowsError
except: except:
pass pass
try: try:
...@@ -546,19 +549,6 @@ class MmapTests(unittest.TestCase): ...@@ -546,19 +549,6 @@ class MmapTests(unittest.TestCase):
pass pass
m.close() m.close()
m1 = mmap.mmap(-1, 1000)
m2 = mmap.mmap(-1, 1000)
try:
m2.resize(5000)
except:
pass
try:
m2[:]
except:
pass
m2.close()
m1.close()
def test_main(): def test_main():
run_unittest(MmapTests) run_unittest(MmapTests)
......
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