summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-17 18:20:34 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-17 18:20:34 (GMT)
commitebe3e16600ddbc19aa7444ec773e2e0786b8a3cf (patch)
tree1189de0bc8de926ef5b1baa2f646cbd1674b8bab /Objects/exceptions.c
parente35553e24c6b90db9ab22298cef663192972bbab (diff)
downloadcpython-ebe3e16600ddbc19aa7444ec773e2e0786b8a3cf.zip
cpython-ebe3e16600ddbc19aa7444ec773e2e0786b8a3cf.tar.gz
cpython-ebe3e16600ddbc19aa7444ec773e2e0786b8a3cf.tar.bz2
Merged revisions 55342-55406 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r55360 | guido.van.rossum | 2007-05-15 14:57:59 -0700 (Tue, 15 May 2007) | 2 lines obcheckin. ........ r55361 | guido.van.rossum | 2007-05-15 14:59:18 -0700 (Tue, 15 May 2007) | 2 lines Get rid of strop module. ........ r55367 | brett.cannon | 2007-05-15 21:06:28 -0700 (Tue, 15 May 2007) | 2 lines Remove the 'pure' module. ........ r55369 | brett.cannon | 2007-05-15 21:07:31 -0700 (Tue, 15 May 2007) | 2 lines Remove the lib-old directory (already empty). ........ r55370 | neal.norwitz | 2007-05-15 21:30:40 -0700 (Tue, 15 May 2007) | 1 line Get rid of a bunch more references to strop ........ r55374 | brett.cannon | 2007-05-15 21:39:00 -0700 (Tue, 15 May 2007) | 2 lines Complete the removal of IRIX-specific modules. ........ r55379 | brett.cannon | 2007-05-15 22:31:54 -0700 (Tue, 15 May 2007) | 2 lines Update removed IRIX modules based on what is gone from removing plat-irix6. ........ r55388 | brett.cannon | 2007-05-16 14:34:52 -0700 (Wed, 16 May 2007) | 2 lines Clean up the docstring for the compiler resource. ........ r55406 | brett.cannon | 2007-05-17 11:05:37 -0700 (Thu, 17 May 2007) | 2 lines Remove BaseException.message (deprecated in Python 2.6). ........
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c57
1 files changed, 1 insertions, 56 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index c15c4ad..fabf359 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -27,7 +27,7 @@ BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!self)
return NULL;
/* the dict is created on the fly in PyObject_GenericSetAttr */
- self->message = self->dict = NULL;
+ self->dict = NULL;
self->args = PyTuple_New(0);
if (!self->args) {
@@ -35,12 +35,6 @@ BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
}
- self->message = PyString_FromString("");
- if (!self->message) {
- Py_DECREF(self);
- return NULL;
- }
-
return (PyObject *)self;
}
@@ -54,11 +48,6 @@ BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
self->args = args;
Py_INCREF(self->args);
- if (PyTuple_GET_SIZE(self->args) == 1) {
- Py_CLEAR(self->message);
- self->message = PyTuple_GET_ITEM(self->args, 0);
- Py_INCREF(self->message);
- }
return 0;
}
@@ -67,7 +56,6 @@ BaseException_clear(PyBaseExceptionObject *self)
{
Py_CLEAR(self->dict);
Py_CLEAR(self->args);
- Py_CLEAR(self->message);
return 0;
}
@@ -84,7 +72,6 @@ BaseException_traverse(PyBaseExceptionObject *self, visitproc visit, void *arg)
{
Py_VISIT(self->dict);
Py_VISIT(self->args);
- Py_VISIT(self->message);
return 0;
}
@@ -231,42 +218,10 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val)
return 0;
}
-static PyObject *
-BaseException_get_message(PyBaseExceptionObject *self)
-{
- int ret;
- ret = PyErr_WarnEx(PyExc_DeprecationWarning,
- "BaseException.message has been deprecated as "
- "of Python 2.6",
- 1);
- if (ret == -1)
- return NULL;
-
- Py_INCREF(self->message);
- return self->message;
-}
-
-static int
-BaseException_set_message(PyBaseExceptionObject *self, PyObject *val)
-{
- int ret;
- ret = PyErr_WarnEx(PyExc_DeprecationWarning,
- "BaseException.message has been deprecated as "
- "of Python 2.6",
- 1);
- if (ret == -1)
- return -1;
- Py_INCREF(val);
- Py_DECREF(self->message);
- self->message = val;
- return 0;
-}
static PyGetSetDef BaseException_getset[] = {
{"__dict__", (getter)BaseException_get_dict, (setter)BaseException_set_dict},
{"args", (getter)BaseException_get_args, (setter)BaseException_set_args},
- {"message", (getter)BaseException_get_message,
- (setter)BaseException_set_message},
{NULL},
};
@@ -453,8 +408,6 @@ SystemExit_traverse(PySystemExitObject *self, visitproc visit, void *arg)
}
static PyMemberDef SystemExit_members[] = {
- {"message", T_OBJECT, offsetof(PySystemExitObject, message), 0,
- PyDoc_STR("exception message")},
{"code", T_OBJECT, offsetof(PySystemExitObject, code), 0,
PyDoc_STR("exception code")},
{NULL} /* Sentinel */
@@ -655,8 +608,6 @@ EnvironmentError_str(PyEnvironmentErrorObject *self)
}
static PyMemberDef EnvironmentError_members[] = {
- {"message", T_OBJECT, offsetof(PyEnvironmentErrorObject, message), 0,
- PyDoc_STR("exception message")},
{"errno", T_OBJECT, offsetof(PyEnvironmentErrorObject, myerrno), 0,
PyDoc_STR("exception errno")},
{"strerror", T_OBJECT, offsetof(PyEnvironmentErrorObject, strerror), 0,
@@ -888,8 +839,6 @@ WindowsError_str(PyWindowsErrorObject *self)
}
static PyMemberDef WindowsError_members[] = {
- {"message", T_OBJECT, offsetof(PyWindowsErrorObject, message), 0,
- PyDoc_STR("exception message")},
{"errno", T_OBJECT, offsetof(PyWindowsErrorObject, myerrno), 0,
PyDoc_STR("POSIX exception code")},
{"strerror", T_OBJECT, offsetof(PyWindowsErrorObject, strerror), 0,
@@ -1120,8 +1069,6 @@ SyntaxError_str(PySyntaxErrorObject *self)
}
static PyMemberDef SyntaxError_members[] = {
- {"message", T_OBJECT, offsetof(PySyntaxErrorObject, message), 0,
- PyDoc_STR("exception message")},
{"msg", T_OBJECT, offsetof(PySyntaxErrorObject, msg), 0,
PyDoc_STR("exception msg")},
{"filename", T_OBJECT, offsetof(PySyntaxErrorObject, filename), 0,
@@ -1569,8 +1516,6 @@ UnicodeError_traverse(PyUnicodeErrorObject *self, visitproc visit, void *arg)
}
static PyMemberDef UnicodeError_members[] = {
- {"message", T_OBJECT, offsetof(PyUnicodeErrorObject, message), 0,
- PyDoc_STR("exception message")},
{"encoding", T_OBJECT, offsetof(PyUnicodeErrorObject, encoding), 0,
PyDoc_STR("exception encoding")},
{"object", T_OBJECT, offsetof(PyUnicodeErrorObject, object), 0,