[Python-checkins] cpython: Fix usage of PyUnicode_READY() in PyUnicode_GetLength()

victor.stinner python-checkins at python.org
Sun Oct 2 01:14:18 CEST 2011


http://hg.python.org/cpython/rev/745fe40c9bbe
changeset:   72576:745fe40c9bbe
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Sun Oct 02 00:36:53 2011 +0200
summary:
  Fix usage of PyUnicode_READY() in PyUnicode_GetLength()

files:
  Objects/unicodeobject.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -2838,7 +2838,7 @@
 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;
     }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list