summaryrefslogtreecommitdiff
path: root/Objects/unicodeobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/unicodeobject.c')
-rw-r--r--Objects/unicodeobject.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 886d0249c7..594623c0bc 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -10201,6 +10201,9 @@ unicode_expandtabs(PyUnicodeObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "|i:expandtabs", &tabsize))
return NULL;
+ if (PyUnicode_READY(self) == -1)
+ return NULL;
+
/* First pass: determine size of output string */
src_len = PyUnicode_GET_LENGTH(self);
i = j = line_pos = 0;