Skip to content

Commit

Permalink
[3.13] pythongh-128198: Add missing error checks for usages of PyIter…
Browse files Browse the repository at this point in the history
…_Next() (pythonGH-128199)

(cherry picked from commit 5c814c8)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
  • Loading branch information
WolframAlph authored and serhiy-storchaka committed Dec 26, 2024
1 parent 32adae1 commit fb4ce1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Objects/frameobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ framelocalsproxy_merge(PyObject* self, PyObject* other)

Py_DECREF(iter);

if (PyErr_Occurred()) {
return -1;
}

return 0;
}

Expand Down
4 changes: 4 additions & 0 deletions Objects/namespaceobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ namespace_repr(PyObject *ns)
goto error;
}

if (PyErr_Occurred()) {
goto error;
}

separator = PyUnicode_FromString(", ");
if (separator == NULL)
goto error;
Expand Down

0 comments on commit fb4ce1a

Please sign in to comment.