mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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). ........
This commit is contained in:
parent
e35553e24c
commit
ebe3e16600
50 changed files with 84 additions and 5860 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue