diff options
author | Georg Brandl <georg@python.org> | 2008-03-21 20:21:46 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-03-21 20:21:46 (GMT) |
commit | 07e5681fd3a8c7169f569f6b70aa824f203f89d9 (patch) | |
tree | 8922fd314337ae4d1f61bb9babc15f41418c12ba /Objects/methodobject.c | |
parent | 5a44424c5e6b9533b12773fadeaf436903ca855e (diff) | |
download | cpython-07e5681fd3a8c7169f569f6b70aa824f203f89d9.zip cpython-07e5681fd3a8c7169f569f6b70aa824f203f89d9.tar.gz cpython-07e5681fd3a8c7169f569f6b70aa824f203f89d9.tar.bz2 |
#2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r-- | Objects/methodobject.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 5b9a364..16175f9 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -352,8 +352,15 @@ PyObject * Py_FindMethodInChain(PyMethodChain *chain, PyObject *self, const char *name) { if (name[0] == '_' && name[1] == '_') { - if (strcmp(name, "__methods__") == 0) + if (strcmp(name, "__methods__") == 0) { + if (Py_Py3kWarningFlag) { + if (PyErr_Warn(PyExc_DeprecationWarning, + "__methods__ not supported " + "in 3.x") < 0) + return NULL; + } return listmethodchain(chain); + } if (strcmp(name, "__doc__") == 0) { const char *doc = self->ob_type->tp_doc; if (doc != NULL) |