diff options
author | Matti Picus <matti.picus@gmail.com> | 2019-03-09 20:43:04 +0200 |
---|---|---|
committer | Matti Picus <matti.picus@gmail.com> | 2019-03-09 20:43:04 +0200 |
commit | 58e48e0ee2efb69a0e7bc7238ac8ba581f0aa6c7 (patch) | |
tree | 7395b1b4d2019cbe6789495320cb65ba413d7715 /pypy/objspace/std/unicodeobject.py | |
parent | pin pytest to 4.0 since they deprecated raises(Exception, "test as str") in 4.1 (diff) | |
download | pypy-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.py | 2 |
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 |