summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-05 14:52:44 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-05 14:52:44 (GMT)
commit09033068f1ecabe9524353a82349e5b290aa1729 (patch)
treeb7cefeed707c5c1ba05cb4d862b8fa89704cb39b /Lib
parent264fc12fbff471d137f61e5fd7152f5a7df9eb6c (diff)
downloadcpython-09033068f1ecabe9524353a82349e5b290aa1729.zip
cpython-09033068f1ecabe9524353a82349e5b290aa1729.tar.gz
cpython-09033068f1ecabe9524353a82349e5b290aa1729.tar.bz2
mmap.resize for anonymous map is not working yet, so changed to real file mapping...
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_mmap.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index bed5d2b..31daa8d 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -535,9 +535,12 @@ class MmapTests(unittest.TestCase):
m.close()
# 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:
- m.resize(0)
+ m.resize(0) # will raise WindowsError
except:
pass
try:
@@ -546,19 +549,6 @@ class MmapTests(unittest.TestCase):
pass
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():
run_unittest(MmapTests)