Index: Objects/exceptions.c =================================================================== --- Objects/exceptions.c (revision 61480) +++ Objects/exceptions.c (working copy) @@ -189,6 +189,11 @@ static PyObject * BaseException_getitem(PyBaseExceptionObject *self, Py_ssize_t index) { + if (Py_Py3kWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "In 3.x, __getitem__ is not supported for exception" + " classes, use args attribute")) + return NULL; return PySequence_GetItem(self->args, index); } @@ -196,6 +201,11 @@ BaseException_getslice(PyBaseExceptionObject *self, Py_ssize_t start, Py_ssize_t stop) { + if (Py_Py3kWarningFlag && + PyErr_Warn(PyExc_DeprecationWarning, + "In 3.x, __getslice__ is not supported for exception" + " classes, use args attribute")) + return NULL; return PySequence_GetSlice(self->args, start, stop); }