]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix usage of PyUnicode_READY() in PyUnicode_GetLength()
authorVictor Stinner <victor.stinner@haypocalc.com>
Sat, 1 Oct 2011 22:36:53 +0000 (00:36 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Sat, 1 Oct 2011 22:36:53 +0000 (00:36 +0200)
Objects/unicodeobject.c

index 3ce845c3af3a84dafb5a70b1794a0edb68e5486f..7215517abacd4dcc0c4b3b80eb1f90ddba1ac11c 100644 (file)
@@ -2838,7 +2838,7 @@ PyUnicode_GetSize(PyObject *unicode)
 Py_ssize_t
 PyUnicode_GetLength(PyObject *unicode)
 {
-    if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) != -1) {
+    if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) == -1) {
         PyErr_BadArgument();
         return -1;
     }