commit | d3a83d5eb345ef1de87419d145a83c156ebf26f8 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 01 03:09:33 2011 +0200 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 01 03:09:33 2011 +0200 |
tree | 433bc073843a3c4982bda32b752965da9c8b1b37 | |
parent | 67ca64ce54012d1e322cb275cee55704cf73d46d [diff] [blame] |
PyUnicode_FromObject() ensures that its output is a ready string
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a26fd2f..fed2cc9 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -2068,6 +2068,8 @@ /* 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; }