[3.13] gh-121474: Add threading.Barrier parties arg sanity check. (GH-121480) (GH-122444)

(cherry picked from commit d27a53fc02)

Co-authored-by: Clinton <pygeek@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2024-07-30 11:24:35 +02:00 committed by GitHub
parent 466bb0d7ea
commit 202cfbfb7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 0 deletions

View file

@ -689,6 +689,8 @@ def __init__(self, parties, action=None, timeout=None):
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