8000 gh-104372: use == -1 before PyErr_Occurred by gpshead · Pull Request #104831 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-104372: use == -1 before PyErr_Occurred #104831

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2023
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
0