mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +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
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue