diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -2,7 +2,7 @@ from test.test_support import TESTFN, run_unittest, import_module, unlink, requires import binascii import random -from test.test_support import precisionbigmemtest, _1G +from test.test_support import precisionbigmemtest, _1G, _2G, _4G import sys try: @@ -75,17 +75,16 @@ # Issue #11277 - check that inputs of 2 GB are handled correctly. # Be aware of issues #1202, #8650, #8651 and #10276 class ChecksumBigBufferTestCase(unittest.TestCase): - int_max = 0x7FFFFFFF - + @unittest.skipUnless(sys.maxsize > _4G, "Can't run on a 32-bit system.") @unittest.skipUnless(mmap, "mmap() is not available.") def test_big_buffer(self): if sys.platform[:3] == 'win' or sys.platform == 'darwin': requires('largefile', 'test requires %s bytes and a long time to run' % - str(self.int_max)) + str(_2G -1)) try: with open(TESTFN, "wb+") as f: - f.seek(self.int_max-4) + f.seek(_2G -1-4) f.write("asdf") f.flush() m = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)