Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r94967:739c19660589
Date: 2018-08-07 09:14 -0700
http://bitbucket.org/pypy/pypy/changeset/739c19660589/
Log: revert wrong rpython change
diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py
--- a/rpython/rlib/runicode.py
+++ b/rpython/rlib/runicode.py
@@ -383,12 +383,9 @@
# will never be called. This causes RPython
# problems. Avoid it with the nonconst hack.
if not allow_surrogates or nonconst.NonConstant(False):
- utf8 = s
- if isinstance(s, unicode):
- utf8 = s.encode('utf8')
ru, rs, pos = errorhandler(errors, 'utf8',
'surrogates not allowed',
- utf8, pos-1, pos)
+ s, pos-1, pos)
if rs is not None:
# py3k only
result.append(rs)
@@ -399,7 +396,7 @@
else:
errorhandler('strict', 'utf8',
'surrogates not allowed',
- utf8, pos-1, pos)
+ s, pos-1, pos)
continue
# else: Fall through and handles isolated high surrogates
result.append((chr((0xe0 | (ch >> 12)))))
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit