aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2019-03-09 20:43:04 +0200
committerMatti Picus <matti.picus@gmail.com>2019-03-09 20:43:04 +0200
commit58e48e0ee2efb69a0e7bc7238ac8ba581f0aa6c7 (patch)
tree7395b1b4d2019cbe6789495320cb65ba413d7715 /pypy/objspace/std/unicodeobject.py
parentpin pytest to 4.0 since they deprecated raises(Exception, "test as str") in 4.1 (diff)
downloadpypy-58e48e0ee2efb69a0e7bc7238ac8ba581f0aa6c7.tar.gz
pypy-58e48e0ee2efb69a0e7bc7238ac8ba581f0aa6c7.tar.bz2
pypy-58e48e0ee2efb69a0e7bc7238ac8ba581f0aa6c7.zip
change test of utf8 length, len(u) != codepoints on narrow builds
Diffstat (limited to 'pypy/objspace/std/unicodeobject.py')
-rw-r--r--pypy/objspace/std/unicodeobject.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
index 4c87cf5ce2..1eaf97a496 100644
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -44,7 +44,7 @@ class W_UnicodeObject(W_Root):
if not we_are_translated():
try:
# best effort, too expensive to handle surrogates
- ulength = len(utf8str.decode('utf8'))
+ ulength = rutf8.codepoints_in_utf(utf8str)
except:
ulength = length
assert ulength == length