closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)

(cherry picked from commit 45a30af109)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-06-27 09:45:30 -07:00 committed by GitHub
parent 4cbe7a3ce4
commit 6fbed5350c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View file

@ -6416,6 +6416,9 @@ os_sched_setaffinity_impl(PyObject *module, pid_t pid, PyObject *mask)
}
CPU_SET_S(cpu, setsize, cpu_set);
}
if (PyErr_Occurred()) {
goto error;
}
Py_CLEAR(iterator);
if (sched_setaffinity(pid, setsize, cpu_set)) {