This commit is contained in:
Raymond Hettinger 2016-11-22 11:50:56 -08:00
commit 3fa28fd075
1 changed files with 3 additions and 1 deletions

View File

@ -3146,8 +3146,10 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
if (enter == NULL)
goto error;
exit = special_lookup(mgr, &PyId___exit__);
if (exit == NULL)
if (exit == NULL) {
Py_DECREF(enter);
goto error;
}
SET_TOP(exit);
Py_DECREF(mgr);
res = PyObject_CallFunctionObjArgs(enter, NULL);