summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
diff options
context:
space:
mode:
authorClinton <pygeek@users.noreply.github.com>2024-07-30 08:53:07 (GMT)
committerGitHub <noreply@github.com>2024-07-30 08:53:07 (GMT)
commitd27a53fc02a87e76066fc4e15ff1fff3922a482d (patch)
tree2cc1bfaaa7b9c040774dbe77e628658267cc5fcd /Lib/threading.py
parent3a9b2aae615165a40614db9aaa8b90c55ff0c7f9 (diff)
downloadcpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.zip
cpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.tar.gz
cpython-d27a53fc02a87e76066fc4e15ff1fff3922a482d.tar.bz2
gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480)
Diffstat (limited to 'Lib/threading.py')
-rw-r--r--Lib/threading.py2
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