Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Python/pythonrun.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename,
if (xs == NULL) {
goto err;
}
PyObject *ln = PyObject_GetAttr(exc, &_Py_ID(lineno));
if (ln == NULL) {
PyObject *exc_lineno = PyObject_GetAttr(exc, &_Py_ID(lineno));
if (exc_lineno == NULL) {
Py_DECREF(xs);
goto err;
}
int n = PyLong_AsInt(ln);
Py_DECREF(ln);
int n = PyLong_AsInt(exc_lineno);
Py_DECREF(exc_lineno);
if (n <= 0 || n > PyList_GET_SIZE(xs)) {
Comment thread
picnixz marked this conversation as resolved.
Py_DECREF(xs);
goto err;
Expand Down