summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2007-02-27 00:15:55 (GMT)
committerBrett Cannon <bcannon@gmail.com>2007-02-27 00:15:55 (GMT)
commitba7bf49a54223b940b773c8678ab8c60da12a155 (patch)
tree48a0d5941089fdf3a1bc926ac6b94be26c84529e /Objects
parent44c526174d9296ce358ccee9652382e7ea5377f4 (diff)
downloadcpython-ba7bf49a54223b940b773c8678ab8c60da12a155.zip
cpython-ba7bf49a54223b940b773c8678ab8c60da12a155.tar.gz
cpython-ba7bf49a54223b940b773c8678ab8c60da12a155.tar.bz2
Remove the ability to slice/index on exceptions per PEP 352.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/exceptions.c29
1 files changed, 1 insertions, 28 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index cea41f8..be3302b 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -174,33 +174,6 @@ static PyMethodDef BaseException_methods[] = {
};
-
-static PyObject *
-BaseException_getitem(PyBaseExceptionObject *self, Py_ssize_t index)
-{
- return PySequence_GetItem(self->args, index);
-}
-
-static PyObject *
-BaseException_getslice(PyBaseExceptionObject *self,
- Py_ssize_t start, Py_ssize_t stop)
-{
- return PySequence_GetSlice(self->args, start, stop);
-}
-
-static PySequenceMethods BaseException_as_sequence = {
- 0, /* sq_length; */
- 0, /* sq_concat; */
- 0, /* sq_repeat; */
- (ssizeargfunc)BaseException_getitem, /* sq_item; */
- (ssizessizeargfunc)BaseException_getslice, /* sq_slice; */
- 0, /* sq_ass_item; */
- 0, /* sq_ass_slice; */
- 0, /* sq_contains; */
- 0, /* sq_inplace_concat; */
- 0 /* sq_inplace_repeat; */
-};
-
static PyMemberDef BaseException_members[] = {
{"message", T_OBJECT, offsetof(PyBaseExceptionObject, message), 0,
PyDoc_STR("exception message")},
@@ -283,7 +256,7 @@ static PyTypeObject _PyExc_BaseException = {
0, /* tp_compare; */
(reprfunc)BaseException_repr, /*tp_repr*/
0, /*tp_as_number*/
- &BaseException_as_sequence, /*tp_as_sequence*/
+ 0, /*tp_as_sequence*/
0, /*tp_as_mapping*/
0, /*tp_hash */
0, /*tp_call*/