Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r96094:2e27a5ddeaed
Date: 2019-02-19 14:18 +0200
http://bitbucket.org/pypy/pypy/changeset/2e27a5ddeaed/

Log:    fix

diff --git a/pypy/module/_codecs/interp_codecs.py 
b/pypy/module/_codecs/interp_codecs.py
--- a/pypy/module/_codecs/interp_codecs.py
+++ b/pypy/module/_codecs/interp_codecs.py
@@ -736,7 +736,7 @@
         result = unicodehelper.utf8_encode_utf_8(utf8, errors,
                      state.encode_error_handler, allow_surrogates=False)
     except IndexError as e:
-        raise oefmt(space.w_IndexError, e.args[0])
+        raise oefmt(space.w_IndexError, '%s' % e.args[0])
     return space.newtuple([space.newbytes(result), space.newint(lgt)])
 
 @unwrap_spec(string='bufferstr', errors='text_or_none',
diff --git a/pypy/module/cpyext/unicodeobject.py 
b/pypy/module/cpyext/unicodeobject.py
--- a/pypy/module/cpyext/unicodeobject.py
+++ b/pypy/module/cpyext/unicodeobject.py
@@ -94,7 +94,7 @@
     try:
         s_utf8 = rffi.wcharpsize2utf8(get_wbuffer(py_obj), lgt)
     except ValueError as e:
-        raise oefmt(space.w_ValueError, e.args[0])
+        raise oefmt(space.w_ValueError, '%s' % e.args[0])
     w_type = from_ref(space, rffi.cast(PyObject, py_obj.c_ob_type))
     w_obj = space.allocate_instance(unicodeobject.W_UnicodeObject, w_type)
     w_obj.__init__(s_utf8, lgt)
@@ -288,7 +288,7 @@
         w_obj = from_ref(space, rffi.cast(PyObject, py_obj))
     else:
         s = kind_to_name.get(kind, "INVALID")
-        raise oefmt(ValueError,
+        raise oefmt(space.w_ValueError,
             "converting %s PyUnicodeObject not supported yet", s)
     return _readify(space, py_obj, space.utf8_w(w_obj))
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to