summaryrefslogtreecommitdiffstats
path: root/Modules/_io/stringio.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-10-04 18:53:03 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-10-04 18:53:03 (GMT)
commite1335c711c555567a9951dd5c1dfde85545445d4 (patch)
treece073dc242b4399ed8bcc67062d7896fb717908d /Modules/_io/stringio.c
parente06e145943854d398adfe053cec757e269af0631 (diff)
downloadcpython-e1335c711c555567a9951dd5c1dfde85545445d4.zip
cpython-e1335c711c555567a9951dd5c1dfde85545445d4.tar.gz
cpython-e1335c711c555567a9951dd5c1dfde85545445d4.tar.bz2
Fix usage og PyUnicode_READY()
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);