aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2019-04-29 09:43:05 +0200
committerArmin Rigo <arigo@tunes.org>2019-04-29 09:43:05 +0200
commit6122541826e98fe5681bd1bdcc648dd4a3b49cc0 (patch)
tree6acfe1a18a79e128bfdf7286e277f558eb2d6efd /lib-python
parentremove arm32 builds, update for python3 (diff)
downloadpypy-6122541826e98fe5681bd1bdcc648dd4a3b49cc0.tar.gz
pypy-6122541826e98fe5681bd1bdcc648dd4a3b49cc0.tar.bz2
pypy-6122541826e98fe5681bd1bdcc648dd4a3b49cc0.zip
Try to fix this test, failing on 32-bit since the utf-8 merge
Diffstat (limited to 'lib-python')
-rw-r--r--lib-python/2.7/test/test_unicode.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib-python/2.7/test/test_unicode.py b/lib-python/2.7/test/test_unicode.py
index aca80ced58..58456a5c52 100644
--- a/lib-python/2.7/test/test_unicode.py
+++ b/lib-python/2.7/test/test_unicode.py
@@ -1652,10 +1652,10 @@ class UnicodeTest(
# when a string allocation fails with a MemoryError.
# This used to crash the interpreter,
# or leak references when the number was smaller.
- charwidth = 4 if sys.maxunicode >= 0x10000 else 2
+ charwidth = 2 # pypy: the char \u0123 is stored in two utf-8 bytes
# Note: sys.maxsize is half of the actual max allocation because of
# the signedness of Py_ssize_t.
- alloc = lambda: u"a" * (sys.maxsize // charwidth * 2)
+ alloc = lambda: u"\u0123" * (sys.maxsize // charwidth * 2)
self.assertRaises(MemoryError, alloc)
self.assertRaises(MemoryError, alloc)