From: Victor Stinner Date: Sat, 16 Jun 2012 02:53:46 +0000 (+0200) Subject: Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception X-Git-Tag: v3.3.0b1~224 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=07621338fb29444a7b2038da44f3cb57a328a7ce;p=python Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index cf9aec2b1f..267dae1bc7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -3995,11 +3995,12 @@ PyUnicode_GetSize(PyObject *unicode) Py_ssize_t PyUnicode_GetLength(PyObject *unicode) { - if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) == -1) { + if (!PyUnicode_Check(unicode)) { PyErr_BadArgument(); return -1; } - + if (PyUnicode_READY(unicode) == -1) + return -1; return PyUnicode_GET_LENGTH(unicode); }