diff --git a/Objects/object.c b/Objects/object.c index 8597d888fb7..4b210f10b57 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -435,14 +435,9 @@ PyObject_Unicode(PyObject *v) PyObject *str; static PyObject *unicodestr; - if (v == NULL) { - res = PyString_FromString(""); - if (res == NULL) - return NULL; - str = PyUnicode_FromEncodedObject(res, NULL, "strict"); - Py_DECREF(res); - return str; - } else if (PyUnicode_CheckExact(v)) { + if (v == NULL) + return PyUnicode_FromString(""); + else if (PyUnicode_CheckExact(v)) { Py_INCREF(v); return v; }