mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.
This commit is contained in:
parent
5a44424c5e
commit
07e5681fd3
4 changed files with 30 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue