From: Victor Stinner Date: Sat, 1 Oct 2011 01:09:33 +0000 (+0200) Subject: PyUnicode_FromObject() ensures that its output is a ready string X-Git-Tag: v3.3.0a1~1414 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3a83d5eb345ef1de87419d145a83c156ebf26f8;p=thirdparty%2FPython%2Fcpython.git PyUnicode_FromObject() ensures that its output is a ready string --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a26fd2f68b64..fed2cc9fb4f0 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; }