diff options
author | Benjamin Peterson <benjamin@python.org> | 2012-02-20 01:02:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2012-02-20 01:02:57 (GMT) |
commit | 23d7f12ffb8983fa670ef289a03c3d55153f37ce (patch) | |
tree | 23eafcf933a4f63c8092e5ad9171000168ffd169 /Modules/_io/iobase.c | |
parent | 8eb1269c346fa860acce9459c0bed065ffccd3ce (diff) | |
download | cpython-23d7f12ffb8983fa670ef289a03c3d55153f37ce.zip cpython-23d7f12ffb8983fa670ef289a03c3d55153f37ce.tar.gz cpython-23d7f12ffb8983fa670ef289a03c3d55153f37ce.tar.bz2 |
use new generic __dict__ descriptor implementations
Diffstat (limited to 'Modules/_io/iobase.c')
-rw-r--r-- | Modules/_io/iobase.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/Modules/_io/iobase.c b/Modules/_io/iobase.c index 3bce1a5..b30bbb6 100644 --- a/Modules/_io/iobase.c +++ b/Modules/_io/iobase.c @@ -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} }; |