fix overflow detection of strop.expandtabs
diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py
index 8ce29ef..45c90a6 100644
--- a/Lib/test/test_strop.py
+++ b/Lib/test/test_strop.py
@@ -4,6 +4,7 @@
r'test.test_strop|unittest')
import strop
import unittest
+import sys
from test import test_support
@@ -115,6 +116,11 @@
strop.uppercase
strop.whitespace
+ @unittest.skipUnless(sys.maxsize == 2147483647, "only for 32-bit")
+ def test_expandtabs_overflow(self):
+ s = '\t\n' * 0x10000 + 'A' * 0x1000000
+ self.assertRaises(OverflowError, strop.expandtabs, s, 0x10001)
+
@test_support.precisionbigmemtest(size=test_support._2G - 1, memuse=5)
def test_stropjoin_huge_list(self, size):
a = "A" * size