summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2016-11-22 01:24:58 (GMT)
committerRaymond Hettinger <python@rcn.com>2016-11-22 01:24:58 (GMT)
commit9af740b99a19a85ad5f38379b6175cf4ead685ba (patch)
treede76487e51219a7715b441643be24bd8827c4397 /Python/ceval.c
parent21fb9f17619f8b360d2444b098f0fba511969df4 (diff)
parenta3fec1543dc252934e79a4a50b1cbbf4708b4e7e (diff)
downloadcpython-9af740b99a19a85ad5f38379b6175cf4ead685ba.zip
cpython-9af740b99a19a85ad5f38379b6175cf4ead685ba.tar.gz
cpython-9af740b99a19a85ad5f38379b6175cf4ead685ba.tar.bz2
merge
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b08427d..b18fd91 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3141,15 +3141,15 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
_Py_IDENTIFIER(__exit__);
_Py_IDENTIFIER(__enter__);
PyObject *mgr = TOP();
- PyObject *exit = special_lookup(mgr, &PyId___exit__), *enter;
+ PyObject *enter = special_lookup(mgr, &PyId___enter__), *exit;
PyObject *res;
+ if (enter == NULL)
+ goto error;
+ exit = special_lookup(mgr, &PyId___exit__);
if (exit == NULL)
goto error;
SET_TOP(exit);
- enter = special_lookup(mgr, &PyId___enter__);
Py_DECREF(mgr);
- if (enter == NULL)
- goto error;
res = PyObject_CallFunctionObjArgs(enter, NULL);
Py_DECREF(enter);
if (res == NULL)