summaryrefslogtreecommitdiff
path: root/Objects/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c10
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);