| Index: Objects/typeobject.c |
| =================================================================== |
| --- Objects/typeobject.c (revision 69906) |
| +++ Objects/typeobject.c (working copy) |
| @@ -2630,6 +2630,12 @@ |
| PyObject *list, *raw, *ref; |
| Py_ssize_t i, n; |
| + if (PyEval_GetRestricted()) { |
| + PyErr_SetString(PyExc_RuntimeError, |
| + "__subclasses__ is not accessible in restricted mode."); |
| + return NULL; |
| + } |
| + |
| list = PyList_New(0); |
| if (list == NULL) |
| return NULL; |