Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: Changeset: r75900:9f349766cc7d Date: 2015-02-15 19:36 +0100 http://bitbucket.org/pypy/pypy/changeset/9f349766cc7d/
Log: Rename function unicodehelper.encode_error_handler(), it is used in many places in py3k, and it's too dangerous to change the raised exception. diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -25,8 +25,8 @@ self.reason = reason @specialize.memo() -def encode_error_handler(space): - # Fast version of the "strict" errors handler. +def rpy_encode_error_handler(): + # A RPython version of the "strict" error handler. def raise_unicode_exception_encode(errors, encoding, msg, u, startingpos, endingpos): raise RUnicodeEncodeError(encoding, u, startingpos, endingpos, msg) diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -439,12 +439,12 @@ try: if encoding == 'ascii': u = space.unicode_w(w_object) - eh = unicodehelper.encode_error_handler(space) + eh = unicodehelper.rpy_encode_error_handler() return space.wrap(unicode_encode_ascii( u, len(u), None, errorhandler=eh)) if encoding == 'utf-8': u = space.unicode_w(w_object) - eh = unicodehelper.encode_error_handler(space) + eh = unicodehelper.rpy_encode_error_handler() return space.wrap(unicode_encode_utf_8( u, len(u), None, errorhandler=eh, allow_surrogates=True)) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit