summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-05 15:00:28 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2009-03-05 15:00:28 (GMT)
commit9b78925970b38d6e56631dbcd83c2ae0e33b11a6 (patch)
tree9dda56f901695d08a13fda3c003f4909c0219614 /Lib/test
parent8e722bcf85641d0519f39c9ca31348c3b7a1d12e (diff)
downloadcpython-9b78925970b38d6e56631dbcd83c2ae0e33b11a6.zip
cpython-9b78925970b38d6e56631dbcd83c2ae0e33b11a6.tar.gz
cpython-9b78925970b38d6e56631dbcd83c2ae0e33b11a6.tar.bz2
Merged revisions 70193 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r70193 | hirokazu.yamamoto | 2009-03-05 23:52:44 +0900 | 1 line mmap.resize for anonymous map is not working yet, so changed to real file mapping... ........
Diffstat (limited to 'Lib/test')
-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 618d6c2..7e0599a 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -540,9 +540,12 @@ class MmapTests(unittest.TestCase):
m.close()
# Should not crash (Issue 5385)
- m = mmap.mmap(-1, 1000)
+ open(TESTFN, "wb").write(b"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:
@@ -551,19 +554,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)