aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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