Skip to content
Merged
Changes from all 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
gh-104372: use == -1 before PyErr_Occurred
The ideal pattern for this.  (already in the 3.11 backport)
  • Loading branch information
gpshead committed May 24, 2023
commit eefb96d656e88f64f1db9b6ca08e2f6e436b48e5
2 changes: 1 addition & 1 deletion Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ convert_fds_to_keep_to_c(PyObject *py_fds_to_keep, int *c_fds_to_keep)
for (i = 0; i < len; ++i) {
PyObject* fdobj = PyTuple_GET_ITEM(py_fds_to_keep, i);
long fd = PyLong_AsLong(fdobj);
if (PyErr_Occurred()) {
if (fd == -1 && PyErr_Occurred()) {
return -1;
}
if (fd < 0 || fd > INT_MAX) {
Expand Down