diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2011-11-04 10:16:41 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2011-11-04 10:16:41 (GMT) |
commit | b09af03b8acc54076762e84393e446b68c861500 (patch) | |
tree | 441e94573e938e54cc2536478a80b2c9ecb64229 /Objects/exceptions.c | |
parent | 495dcbd5c13007dfd679edc8067131228c65bccb (diff) | |
download | cpython-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/exceptions.c')
-rw-r--r-- | Objects/exceptions.c | 5 |
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); |