summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-01-16 19:28:50 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-01-16 19:28:50 (GMT)
commiteea4846d23e2b6967f1e45561603652751b63fbe (patch)
tree41f763f42f320af15e0831943be775e27daf04e9 /Objects
parentd120083c144344d1b715fe29f4e74bbc20e8c89f (diff)
downloadcpython-eea4846d23e2b6967f1e45561603652751b63fbe.zip
cpython-eea4846d23e2b6967f1e45561603652751b63fbe.tar.gz
cpython-eea4846d23e2b6967f1e45561603652751b63fbe.tar.bz2
don't ready in case_operation, since most callers do it themselves
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c7
1 files changed, 5 insertions, 2 deletions
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 @@ case_operation(PyObject *self,
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 @@ characters, all remaining cased characters have lower case.");
static PyObject*
unicode_title(PyObject *self)
{
+ if (PyUnicode_READY(self) == -1)
+ return NULL;
return case_operation(self, do_title);
}
@@ -12657,6 +12658,8 @@ and vice versa.");
static PyObject*
unicode_swapcase(PyObject *self)
{
+ if (PyUnicode_READY(self) == -1)
+ return NULL;
return case_operation(self, do_swapcase);
}