diff options
-rw-r--r-- | Objects/object.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/Objects/object.c b/Objects/object.c index 81f5669..8597d88 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -361,15 +361,8 @@ PyObject_Repr(PyObject *v) res = (*v->ob_type->tp_repr)(v); if (res == NULL) return NULL; - if (PyUnicode_Check(res)) { - PyObject* str; - str = PyUnicode_AsEncodedString(res, NULL, NULL); - Py_DECREF(res); - if (str) - res = str; - else - return NULL; - } + if (PyUnicode_Check(res)) + return res; if (!PyString_Check(res)) { PyErr_Format(PyExc_TypeError, "__repr__ returned non-string (type %.200s)", |