gh-129403: Fix ValueError messages in asyncio.Barrier and threading.Barrier (#129419)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
Stan Ulbrych 2025-01-30 08:11:12 +00:00 committed by GitHub
parent a4722449ca
commit bcb25d60b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View file

@ -485,7 +485,7 @@ class Barrier(mixins._LoopBoundMixin):
def __init__(self, parties):
"""Create a barrier, initialised to 'parties' tasks."""
if parties < 1:
raise ValueError('parties must be > 0')
raise ValueError('parties must be >= 1')
self._cond = Condition() # notify all tasks when state changes

View file

@ -694,7 +694,7 @@ class Barrier:
"""
if parties < 1:
raise ValueError("parties must be > 0")
raise ValueError("parties must be >= 1")
self._cond = Condition(Lock())
self._action = action
self._timeout = timeout

View file

@ -0,0 +1 @@
Corrected :exc:`ValueError` message for :class:`asyncio.Barrier` and :class:`threading.Barrier`.