Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95065:34e4b4d3147b
Date: 2018-08-31 22:12 +0200
http://bitbucket.org/pypy/pypy/changeset/34e4b4d3147b/
Log: fix ef8722afb037
diff --git a/pypy/interpreter/error.py b/pypy/interpreter/error.py
--- a/pypy/interpreter/error.py
+++ b/pypy/interpreter/error.py
@@ -21,7 +21,7 @@
"""Translate an error code to a unicode message string."""
from pypy.module._codecs.locale import str_decode_locale_surrogateescape
uni = str_decode_locale_surrogateescape(os.strerror(errno))
- return runicode.unicode_encode_utf_8(uni, len(uni), 'strict')
+ return runicode.unicode_encode_utf_8(uni, len(uni), 'strict'), len(uni)
class OperationError(Exception):
"""Interpreter-level exception that signals an exception that should be
diff --git a/pypy/module/_sre/interp_sre.py b/pypy/module/_sre/interp_sre.py
--- a/pypy/module/_sre/interp_sre.py
+++ b/pypy/module/_sre/interp_sre.py
@@ -8,6 +8,7 @@
from rpython.rlib.rarithmetic import intmask
from rpython.rlib import jit
from rpython.rlib.rstring import StringBuilder, UnicodeBuilder
+from rpython.rlib.runicode import unicode_encode_utf_8
# ____________________________________________________________
#
@@ -42,7 +43,7 @@
return space.newbytes(ctx._string[start:end])
elif isinstance(ctx, rsre_core.UnicodeMatchContext):
uni = ctx._unicodestr[start:end]
- uni_utf8 = runicode.unicode_encode_utf_8(uni, len(uni), 'strict')
+ uni_utf8 = unicode_encode_utf_8(uni, len(uni), 'strict')
return space.newtext(uni_utf8, len(uni))
else:
# unreachable
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit