diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-04 18:53:03 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-04 18:53:03 (GMT) |
commit | e1335c711c555567a9951dd5c1dfde85545445d4 (patch) | |
tree | ce073dc242b4399ed8bcc67062d7896fb717908d /Modules/_io/stringio.c | |
parent | e06e145943854d398adfe053cec757e269af0631 (diff) | |
download | cpython-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.c | 4 |
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); |