From: Antoine Pitrou Date: Sat, 12 May 2012 13:49:07 +0000 (+0200) Subject: Fix logic error introduced by 83da67651687. X-Git-Tag: v3.3.0a4~199^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e45c0c5cefaa634ce1bf9efe95523756c60917c7;p=python Fix logic error introduced by 83da67651687. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 9db87be361..97de48f4f8 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -9075,12 +9075,12 @@ PyUnicode_Count(PyObject *str, kind1 = PyUnicode_KIND(str_obj); kind2 = PyUnicode_KIND(sub_obj); - kind = kind2; + kind = kind1; buf1 = PyUnicode_DATA(str_obj); buf2 = PyUnicode_DATA(sub_obj); if (kind2 != kind) { if (kind2 > kind) - return 0; + return 0; buf2 = _PyUnicode_AsKind(sub_obj, kind); } if (!buf2)