diff options
-rw-r--r-- | Python/bltinmodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 2cadb49..d4e9a22 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -542,6 +542,13 @@ builtin_eval(PyObject *self, PyObject *args) else if (locals == Py_None) locals = globals; + if (globals == NULL || locals == NULL) { + PyErr_SetString(PyExc_TypeError, + "eval must be given globals and locals " + "when called without a frame"); + return NULL; + } + if (PyDict_GetItemString(globals, "__builtins__") == NULL) { if (PyDict_SetItemString(globals, "__builtins__", PyEval_GetBuiltins()) != 0) |