* Fix missing return after error message is set.
* Add a test case that would have caught it.
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f4f8b7a..3604601 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -459,12 +459,13 @@
return NULL;
if (locals != Py_None && !PyMapping_Check(locals)) {
PyErr_SetString(PyExc_TypeError, "locals must be a mapping");
- return NULL;
+ return NULL;
}
if (globals != Py_None && !PyDict_Check(globals)) {
PyErr_SetString(PyExc_TypeError, PyMapping_Check(globals) ?
"globals must be a real dict; try eval(expr, {}, mapping)"
: "globals must be a dict");
+ return NULL;
}
if (globals == Py_None) {
globals = PyEval_GetGlobals();