diff options
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); |
