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

Unified Diff: Objects/typeobject.c

Issue 20051: Minimal patch to secure the Python interpreter
Patch Set: 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
« no previous file with comments | « 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
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 4c032e77e459b1061ebcb0b29544602ab916e9e4..ee5cc36ad262fe91a8ddfd8da4d406e99d8bd1f9 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2248,6 +2248,13 @@ type_dealloc(PyTypeObject *type)
static PyObject *
type_subclasses(PyTypeObject *type, PyObject *args_ignored)
{
+
Martin v. Löwis 2009/02/23 22:57:36 The only issue I see here is that this is not C89
+ if (PyEval_GetRestricted()) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "__subclasses__ is not accessible in restricted mode.");
+ return NULL;
+ }
+
PyObject *list, *raw, *ref;
Py_ssize_t i, n;
« no previous file with comments | « 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