diff options
author | Georg Brandl <georg@python.org> | 2008-03-21 20:21:46 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-21 20:21:46 +0000 |
commit | 07e5681fd3a8c7169f569f6b70aa824f203f89d9 (patch) | |
tree | 8922fd314337ae4d1f61bb9babc15f41418c12ba /Objects/object.c | |
parent | 5a44424c5e6b9533b12773fadeaf436903ca855e (diff) | |
download | cpython-git-07e5681fd3a8c7169f569f6b70aa824f203f89d9.tar.gz |
#2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Objects/object.c b/Objects/object.c index a10ac7ce19..4a66f4fee1 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -1687,6 +1687,16 @@ merge_list_attr(PyObject* dict, PyObject* obj, const char *attrname) break; } } + if (Py_Py3kWarningFlag && + (strcmp(attrname, "__members__") == 0 || + strcmp(attrname, "__methods__") == 0)) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "__members__ and __methods__ not supported " + "in 3.x") < 0) { + Py_XDECREF(list); + return -1; + } + } } Py_XDECREF(list); |