use new generic __dict__ descriptor implementations

This commit is contained in:
Benjamin Peterson 2012-02-19 20:02:57 -05:00
parent 8eb1269c34
commit 23d7f12ffb
4 changed files with 6 additions and 141 deletions

View file

@ -159,19 +159,6 @@ iobase_closed_get(PyObject *self, void *context)
return PyBool_FromLong(IS_CLOSED(self));
}
static PyObject *
iobase_get_dict(PyObject *self)
{
PyObject **dictptr = _PyObject_GetDictPtr(self);
PyObject *dict;
assert(dictptr);
dict = *dictptr;
if (dict == NULL)
dict = *dictptr = PyDict_New();
Py_XINCREF(dict);
return dict;
}
PyObject *
_PyIOBase_check_closed(PyObject *self, PyObject *args)
{
@ -714,7 +701,7 @@ static PyMethodDef iobase_methods[] = {
};
static PyGetSetDef iobase_getset[] = {
{"__dict__", (getter)iobase_get_dict, NULL, NULL},
{"__dict__", PyObject_GenericGetDict, NULL, NULL},
{"closed", (getter)iobase_closed_get, NULL, NULL},
{NULL}
};