don't ready in case_operation, since most callers do it themselves
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 59fc123..648d9a0 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -9644,8 +9644,7 @@
void *data, *outdata;
Py_UCS4 maxchar = 0, *tmp, *tmpend;
- if (PyUnicode_READY(self) == -1)
- return NULL;
+ assert(PyUnicode_IS_READY(self));
kind = PyUnicode_KIND(self);
data = PyUnicode_DATA(self);
@@ -10512,6 +10511,8 @@
static PyObject*
unicode_title(PyObject *self)
{
+ if (PyUnicode_READY(self) == -1)
+ return NULL;
return case_operation(self, do_title);
}
@@ -12657,6 +12658,8 @@
static PyObject*
unicode_swapcase(PyObject *self)
{
+ if (PyUnicode_READY(self) == -1)
+ return NULL;
return case_operation(self, do_swapcase);
}