Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7c43dd commit c8c8233Copy full SHA for c8c8233
1 file changed
Objects/object.c
@@ -361,15 +361,8 @@ PyObject_Repr(PyObject *v)
361
res = (*v->ob_type->tp_repr)(v);
362
if (res == NULL)
363
return NULL;
364
- if (PyUnicode_Check(res)) {
365
- PyObject* str;
366
- str = PyUnicode_AsEncodedString(res, NULL, NULL);
367
- Py_DECREF(res);
368
- if (str)
369
- res = str;
370
- else
371
- return NULL;
372
- }
+ if (PyUnicode_Check(res))
+ return res;
373
if (!PyString_Check(res)) {
374
PyErr_Format(PyExc_TypeError,
375
"__repr__ returned non-string (type %.200s)",
0 commit comments