]> granicus.if.org Git - python/commitdiff
Fix buildbot failure following 97a5590b9291
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 6 Mar 2011 00:47:18 +0000 (01:47 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 6 Mar 2011 00:47:18 +0000 (01:47 +0100)
Lib/test/test_mmap.py

index 056b9ec7f3a48a91f7abdd1a56206be3d095bf07..0822cc12c313975a45c02566365b44da4f3551c3 100644 (file)
@@ -237,14 +237,14 @@ class MmapTests(unittest.TestCase):
                               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)