[Python-checkins] cpython (3.1): Fix buildbot failure following 97a5590b9291

antoine.pitrou python-checkins at python.org
Sun Mar 6 01:53:48 CET 2011


http://hg.python.org/cpython/rev/e3eaf7dbb2b4
changeset:   68269:e3eaf7dbb2b4
branch:      3.1
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Mar 06 01:47:18 2011 +0100
summary:
  Fix buildbot failure following 97a5590b9291

files:
  Lib/test/test_mmap.py

diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -237,14 +237,14 @@
                               prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE)
             f.close()
 
-            # Try writting without PROT_WRITE
+            # Try writing with PROT_EXEC and without PROT_WRITE
+            prot = mmap.PROT_READ | getattr(mmap, 'PROT_EXEC', 0)
             with open(TESTFN, "r+b") as f:
-                m = mmap.mmap(f.fileno(), mapsize, prot=~mmap.PROT_WRITE)
+                m = mmap.mmap(f.fileno(), mapsize, prot=prot)
                 self.assertRaises(TypeError, m.write, b"abcdef")
                 self.assertRaises(TypeError, m.write_byte, 0)
                 m.close()
 
-
     def test_bad_file_desc(self):
         # Try opening a bad file descriptor...
         self.assertRaises(mmap.error, mmap.mmap, -2, 4096)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list