diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a26fd2f68b6..fed2cc9fb4f 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2068,6 +2068,8 @@ PyUnicode_FromObject(register PyObject *obj) /* XXX Perhaps we should make this API an alias of PyObject_Str() instead ?! */ if (PyUnicode_CheckExact(obj)) { + if (PyUnicode_READY(obj)) + return NULL; Py_INCREF(obj); return obj; }