diff options
author | Brandt Bucher <brandtbucher@gmail.com> | 2019-06-27 16:10:57 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2019-06-27 16:10:57 (GMT) |
commit | 45a30af109f69a81576b87ea775863ba12d55316 (patch) | |
tree | 34578343231581130fcbd09f49ccebcdb529fdd9 /Modules/posixmodule.c | |
parent | 97d15b1ee06ce80c4dbda91fb538a89bbcb2bed9 (diff) | |
download | cpython-45a30af109f69a81576b87ea775863ba12d55316.zip cpython-45a30af109f69a81576b87ea775863ba12d55316.tar.gz cpython-45a30af109f69a81576b87ea775863ba12d55316.tar.bz2 |
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r-- | Modules/posixmodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 5f17fce..197607c 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6413,6 +6413,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)) { |