Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r90211:ecec05ae43ec Date: 2017-02-19 18:43 +0100 http://bitbucket.org/pypy/pypy/changeset/ecec05ae43ec/
Log: more attempts to fix translation errors diff --git a/rpython/annotator/unaryop.py b/rpython/annotator/unaryop.py --- a/rpython/annotator/unaryop.py +++ b/rpython/annotator/unaryop.py @@ -699,7 +699,7 @@ if enc not in ('ascii', 'latin-1', 'utf-8'): raise AnnotatorError("Encoding %s not supported for unicode" % (enc,)) return SomeString(no_nul=self.no_nul) - method_encode.can_only_throw = [UnicodeEncodeError] + method_encode.can_only_throw = [] class __extend__(SomeString): diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py --- a/rpython/rlib/runicode.py +++ b/rpython/rlib/runicode.py @@ -110,9 +110,6 @@ def ll_unicode_error_decode(errors, encoding, msg, s, startingpos, endingpos): raise UnicodeDecodeError(encoding, s, startingpos, endingpos, msg) -def ll_unicode_error_encode(errors, encoding, msg, u, startingpos, endingpos): - raise UnicodeEncodeError(encoding, u, startingpos, endingpos, msg) - # ____________________________________________________________ # utf-8 @@ -357,7 +354,7 @@ s = NonConstant(u'?????') size = NonConstant(12345) errors = NonConstant('strict') - errorhandler = ll_unicode_error_encode + # no errorhandler needed for rtyper/rstr.py allow_surrogates = NonConstant(True) return unicode_encode_utf_8_elidable(s, size, errors, errorhandler, allow_surrogates=allow_surrogates) diff --git a/rpython/rtyper/rstr.py b/rpython/rtyper/rstr.py --- a/rpython/rtyper/rstr.py +++ b/rpython/rtyper/rstr.py @@ -390,10 +390,8 @@ from rpython.rlib import runicode s = hlunicode(ll_s) assert s is not None - errorhandler = runicode.ll_unicode_error_encode bytes = runicode.unicode_encode_utf_8_elidable( - s, len(s), 'strict', - errorhandler=errorhandler, allow_surrogates=True) + s, len(s), 'strict', None, True) return self.ll.llstr(bytes) def rtype_method_encode(self, hop): _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit