diff options
Diffstat (limited to 'Python/codecs.c')
-rw-r--r-- | Python/codecs.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index cd31e1c..253bc39 100644 --- a/Python/codecs.c +++ b/Python/codecs.c @@ -448,9 +448,8 @@ static void wrong_exception_type(PyObject *exc) PyObject *PyCodec_StrictErrors(PyObject *exc) { - if (PyInstance_Check(exc)) - PyErr_SetObject((PyObject*)((PyInstanceObject*)exc)->in_class, - exc); + if (PyExceptionInstance_Check(exc)) + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); else PyErr_SetString(PyExc_TypeError, "codec must pass exception instance"); return NULL; |