summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_json/test_encode_basestring_ascii.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_json/test_encode_basestring_ascii.py b/Lib/test/test_json/test_encode_basestring_ascii.py
index a2bbc7d5ee..2122da17fd 100644
--- a/Lib/test/test_json/test_encode_basestring_ascii.py
+++ b/Lib/test/test_json/test_encode_basestring_ascii.py
@@ -45,6 +45,7 @@ class TestPyEncodeBasestringAscii(TestEncodeBasestringAscii, PyTest): pass
class TestCEncodeBasestringAscii(TestEncodeBasestringAscii, CTest):
@bigaddrspacetest
def test_overflow(self):
- s = "\uffff"*((2**32)//6 + 1)
+ size = (2**32)//6 + 1
+ s = "\x00"*size
with self.assertRaises(OverflowError):
self.json.encoder.encode_basestring_ascii(s)