diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-07-30 09:24:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-30 09:24:35 (GMT) |
commit | 202cfbfb7cd54fb40240cb23b3b828c4ba4471cf (patch) | |
tree | c19eb4e3fb950e17c327eda32833b5ea8b0cba8c /Lib/threading.py | |
parent | 466bb0d7eac4a4dbd8fb6050a50489680cbfe765 (diff) | |
download | cpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.zip cpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.tar.gz cpython-202cfbfb7cd54fb40240cb23b3b828c4ba4471cf.tar.bz2 |
[3.13] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122444)
(cherry picked from commit d27a53fc02a87e76066fc4e15ff1fff3922a482d)
Co-authored-by: Clinton <pygeek@users.noreply.github.com>
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 2dcdd0c..94ea2f0 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -689,6 +689,8 @@ class Barrier: default for all subsequent 'wait()' calls. """ + if parties < 1: + raise ValueError("parties must be > 0") self._cond = Condition(Lock()) self._action = action self._timeout = timeout |