summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-11-04 10:16:41 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-11-04 10:16:41 (GMT)
commitb09af03b8acc54076762e84393e446b68c861500 (patch)
tree441e94573e938e54cc2536478a80b2c9ecb64229 /Objects
parent495dcbd5c13007dfd679edc8067131228c65bccb (diff)
downloadcpython-b09af03b8acc54076762e84393e446b68c861500.zip
cpython-b09af03b8acc54076762e84393e446b68c861500.tar.gz
cpython-b09af03b8acc54076762e84393e446b68c861500.tar.bz2
Port error handlers from Py_UNICODE indexing to code point indexing.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/exceptions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index ad618ff..5b5447a 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -1513,6 +1513,11 @@ UnicodeEncodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
return -1;
}
+ if (PyUnicode_READY(err->object) < -1) {
+ err->encoding = NULL;
+ return -1;
+ }
+
Py_INCREF(err->encoding);
Py_INCREF(err->object);
Py_INCREF(err->reason);