Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(90)

Unified Diff: Objects/typeobject.c

Issue 20051: Minimal patch to secure the Python interpreter
Patch Set: Post-challenge version of the secure python patch. Created 16 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Objects/genobject.c ('K') | « Objects/genobject.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« Objects/genobject.c ('K') | « Objects/genobject.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b