diff options
author | Benjamin Peterson <benjamin@python.org> | 2010-10-02 18:04:55 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2010-10-02 18:04:55 (GMT) |
commit | 0ad44fa3f7df2e0a56cb0d084115760140bcb86f (patch) | |
tree | 3dd498a7d8b85a170c36d8fff5aba3d1dad30499 /Objects | |
parent | 7f8199a9979c9f100d754d4910d5e1bd6f929d9a (diff) | |
download | cpython-0ad44fa3f7df2e0a56cb0d084115760140bcb86f.zip cpython-0ad44fa3f7df2e0a56cb0d084115760140bcb86f.tar.gz cpython-0ad44fa3f7df2e0a56cb0d084115760140bcb86f.tar.bz2 |
Merged revisions 85154,85182 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r85154 | benjamin.peterson | 2010-10-01 19:03:31 -0500 (Fri, 01 Oct 2010) | 1 line
type.__abstractmethods__ should raise an AttributeError #10006
........
r85182 | benjamin.peterson | 2010-10-02 12:55:47 -0500 (Sat, 02 Oct 2010) | 1 line
add a test and a note about metaclasses now being abcs
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/typeobject.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index ab942c0..d2eb8e2 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -320,8 +320,11 @@ type_set_module(PyTypeObject *type, PyObject *value, void *context) static PyObject * type_abstractmethods(PyTypeObject *type, void *context) { - PyObject *mod = PyDict_GetItemString(type->tp_dict, - "__abstractmethods__"); + PyObject *mod = NULL; + /* type its self has an __abstractmethods__ descriptor (this). Don't + return that. */ + if (type != &PyType_Type) + mod = PyDict_GetItemString(type->tp_dict, "__abstractmethods__"); if (!mod) { PyErr_Format(PyExc_AttributeError, "__abstractmethods__"); return NULL; |