summaryrefslogtreecommitdiff
path: root/Python/codecs.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2006-03-01 04:25:17 +0000
committerBrett Cannon <bcannon@gmail.com>2006-03-01 04:25:17 +0000
commita99c1d8d881c21f9ec22d6839ade0dc1c9a6af36 (patch)
tree79cefe64e3c0ac37bdfb44d1b7088fffdf56b418 /Python/codecs.c
parent53ff69ff36d053fa4bdcf6320cee392b06c7750e (diff)
downloadcpython-a99c1d8d881c21f9ec22d6839ade0dc1c9a6af36.tar.gz
PEP 352 implementation. Creates a new base class, BaseException, which has an
added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
Diffstat (limited to 'Python/codecs.c')
-rw-r--r--Python/codecs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Python/codecs.c b/Python/codecs.c
index cd31e1c9fc..253bc39326 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;