Commit 04b2e69e authored by Antoine Pitrou's avatar Antoine Pitrou

Merge

parents 424246fb 758153ba
......@@ -9075,12 +9075,15 @@ 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)
if (kind2 > kind) {
Py_DECREF(sub_obj);
Py_DECREF(str_obj);
return 0;
}
buf2 = _PyUnicode_AsKind(sub_obj, kind);
}
if (!buf2)
......@@ -10659,8 +10662,11 @@ PyUnicode_Contains(PyObject *container, PyObject *element)
buf1 = PyUnicode_DATA(str);
buf2 = PyUnicode_DATA(sub);
if (kind2 != kind) {
if (kind2 > kind)
if (kind2 > kind) {
Py_DECREF(sub);
Py_DECREF(str);
return 0;
}
buf2 = _PyUnicode_AsKind(sub, kind);
}
if (!buf2) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment