mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fixed bugs noted by Greg Stein
* x wasn't initialized to NULL * Did not DECREF result from displayhook function
This commit is contained in:
parent
ab78beca2f
commit
f5df3834eb
1 changed files with 2 additions and 0 deletions
|
@ -1250,6 +1250,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
|
||||||
PyErr_SetString(PyExc_RuntimeError,
|
PyErr_SetString(PyExc_RuntimeError,
|
||||||
"lost sys.displayhook");
|
"lost sys.displayhook");
|
||||||
err = -1;
|
err = -1;
|
||||||
|
x = NULL;
|
||||||
}
|
}
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
x = Py_BuildValue("(O)", v);
|
x = Py_BuildValue("(O)", v);
|
||||||
|
@ -1258,6 +1259,7 @@ eval_code2(PyCodeObject *co, PyObject *globals, PyObject *locals,
|
||||||
}
|
}
|
||||||
if (err == 0) {
|
if (err == 0) {
|
||||||
w = PyEval_CallObject(w, x);
|
w = PyEval_CallObject(w, x);
|
||||||
|
Py_XDECREF(w);
|
||||||
if (w == NULL)
|
if (w == NULL)
|
||||||
err = -1;
|
err = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue