summaryrefslogtreecommitdiffstats
path: root/Modules/_io/stringio.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_io/stringio.c')
-rw-r--r--Modules/_io/stringio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_io/stringio.c b/Modules/_io/stringio.c
index c40163f..a4536b1 100644
--- a/Modules/_io/stringio.c
+++ b/Modules/_io/stringio.c
@@ -131,6 +131,10 @@ write_str(stringio *self, PyObject *obj)
return -1;
assert(PyUnicode_Check(decoded));
+ if (PyUnicode_READY(decoded)) {
+ Py_DECREF(decoded);
+ return -1;
+ }
len = PyUnicode_GET_LENGTH(decoded);
assert(len >= 0);