[Python-checkins] r70194 - in python/branches/release26-maint: Lib/test/test_mmap.py

hirokazu.yamamoto python-checkins at python.org
Thu Mar 5 15:58:35 CET 2009


Author: hirokazu.yamamoto
Date: Thu Mar  5 15:58:34 2009
New Revision: 70194

Log:
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...
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Lib/test/test_mmap.py

Modified: python/branches/release26-maint/Lib/test/test_mmap.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_mmap.py	(original)
+++ python/branches/release26-maint/Lib/test/test_mmap.py	Thu Mar  5 15:58:34 2009
@@ -535,9 +535,12 @@
             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 @@
                 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)


More information about the Python-checkins mailing list