mirror of
https://github.com/python/cpython.git
synced 2025-08-08 02:48:55 +00:00
[3.12] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122443)
(cherry picked from commit d27a53fc02
)
Co-authored-by: Clinton <pygeek@users.noreply.github.com>
This commit is contained in:
parent
9491d18975
commit
ca2275025b
3 changed files with 8 additions and 0 deletions
|
@ -685,6 +685,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue