summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/ceval.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 3a462af..6c457e1 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1742,8 +1742,10 @@ PyEval_EvalFrame(PyFrameObject *f)
PyObject_REPR(w));
break;
}
- if (PyDict_CheckExact(v))
+ if (PyDict_CheckExact(v)) {
x = PyDict_GetItem(v, w);
+ Py_XINCREF(x);
+ }
else {
x = PyObject_GetItem(v, w);
if (x == NULL && PyErr_Occurred()) {
@@ -1763,8 +1765,8 @@ PyEval_EvalFrame(PyFrameObject *f)
break;
}
}
+ Py_INCREF(x);
}
- Py_INCREF(x);
PUSH(x);
continue;