summaryrefslogtreecommitdiff
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-06-16 04:53:46 +0200
committerVictor Stinner <victor.stinner@gmail.com>2012-06-16 04:53:46 +0200
commit0cc9d6c8c8f0445776ade9923ca0fa0448ef436a (patch)
tree099cff5aeb0a0f7b8980b4be507c429da07f6f8b /Objects
parent544eca519c9d6492e6e96ca3dc8adc079ec1f3e1 (diff)
downloadcpython-0cc9d6c8c8f0445776ade9923ca0fa0448ef436a.tar.gz
Fix PyUnicode_GetSize(): Don't replace _PyUnicode_Ready() exception
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index cf9aec2b1f..267dae1bc7 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3995,11 +3995,12 @@ PyUnicode_GetSize(PyObject *unicode)
Py_ssize_t
PyUnicode_GetLength(PyObject *unicode)
{
- if (!PyUnicode_Check(unicode) || PyUnicode_READY(unicode) == -1) {
+ if (!PyUnicode_Check(unicode)) {
PyErr_BadArgument();
return -1;
}
-
+ if (PyUnicode_READY(unicode) == -1)
+ return -1;
return PyUnicode_GET_LENGTH(unicode);
}