Port error handlers from Py_UNICODE indexing to code point indexing.

This commit is contained in:
Martin v. Löwis 2011-11-04 11:16:41 +01:00
parent 495dcbd5c1
commit b09af03b8a
2 changed files with 51 additions and 77 deletions

View file

@ -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);