diff -r ba84d1e9a742 Python/bltinmodule.c --- a/Python/bltinmodule.c Mon May 26 00:40:09 2014 -0700 +++ b/Python/bltinmodule.c Mon May 26 15:29:24 2014 -0400 @@ -738,6 +738,11 @@ } else if (locals == Py_None) locals = globals; + if (!globals || !locals) { + PyErr_SetString(PyExc_SystemError, + "globals and locals cannot be NULL"); + return NULL; + } if (PyDict_GetItemString(globals, "__builtins__") == NULL) { if (PyDict_SetItemString(globals, "__builtins__", PyEval_GetBuiltins()) != 0)