Author: Ronan Lamy <[email protected]>
Branch: unicode-utf8
Changeset: r93343:0accab6d493c
Date: 2017-12-10 05:25 +0000
http://bitbucket.org/pypy/pypy/changeset/0accab6d493c/
Log: fix
diff --git a/pypy/interpreter/unicodehelper.py
b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -1098,9 +1098,9 @@
elif ch >= 0xE000 or allow_surrogates:
_STORECHAR(result, ch, byteorder)
else:
- ru, newindex = errorhandler(errors, public_encoding_name,
- 'surrogates not allowed',
- s, pos-1, pos)
+ res_8, newindex = errorhandler(
+ errors, public_encoding_name, 'surrogates not allowed',
+ s, pos - 1, pos)
for cp in rutf8.Utf8StringIterator(res_8):
if cp < 0xD800:
_STORECHAR(result, cp, byteorder)
@@ -1279,16 +1279,16 @@
ch = rutf8.codepoint_at_pos(s, pos)
pos = rutf8.next_codepoint_pos(s, pos)
if not allow_surrogates and 0xD800 <= ch < 0xE000:
- res_8, newindex = errorhandler(errors, public_encoding_name,
- 'surrogates not allowed',
- s, pos-1, pos)
+ res_8, newindex = errorhandler(
+ errors, public_encoding_name, 'surrogates not allowed',
+ s, pos - 1, pos)
for ch in rutf8.Utf8StringIterator(res_8):
if ch < 0xD800:
_STORECHAR32(result, ch, byteorder)
else:
- errorhandler('strict', public_encoding_name,
- 'surrogates not allowed',
- s, pos-1, pos)
+ errorhandler(
+ 'strict', public_encoding_name, 'surrogates not
allowed',
+ s, pos - 1, pos)
if index != newindex: # Should be uncommon
index = newindex
pos = rutf8._pos_at_index(s, newindex)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit