Try to fix the test on 64-bit platforms.

This commit is contained in:
Thomas Heller 2008-08-14 20:04:38 +00:00
parent 57adf22f6e
commit 6d2014ee59
1 changed files with 4 additions and 5 deletions

View File

@ -8,11 +8,10 @@ class MemFunctionsTest(unittest.TestCase):
# 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