[Python-checkins] r65682 - python/trunk/Lib/ctypes/test/test_memfunctions.py

thomas.heller python-checkins at python.org
Thu Aug 14 22:04:39 CEST 2008


Author: thomas.heller
Date: Thu Aug 14 22:04:38 2008
New Revision: 65682

Log:
Try to fix the test on 64-bit platforms.


Modified:
   python/trunk/Lib/ctypes/test/test_memfunctions.py

Modified: python/trunk/Lib/ctypes/test/test_memfunctions.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_memfunctions.py	(original)
+++ python/trunk/Lib/ctypes/test/test_memfunctions.py	Thu Aug 14 22:04:38 2008
@@ -8,11 +8,10 @@
         # convention (which acquires the GIL and checks the Python
         # error flag).  Provoke an error and catch it; see also issue
         # #3554: <http://bugs.python.org/issue3554>
-        if hasattr(sys, "maxsize"):
-            self.assertRaises((OverflowError, MemoryError),
-                              lambda: wstring_at(u"foo", sys.maxsize))
-            self.assertRaises((OverflowError, MemoryError),
-                              lambda: string_at("foo", sys.maxsize))
+        self.assertRaises((OverflowError, MemoryError, SystemError),
+                          lambda: wstring_at(u"foo", sys.maxint - 1))
+        self.assertRaises((OverflowError, MemoryError, SystemError),
+                          lambda: string_at("foo", sys.maxint - 1))
 
     def test_memmove(self):
         # large buffers apparently increase the chance that the memory


More information about the Python-checkins mailing list