Skip to content

Commit bcb25d6

Browse files
gh-129403: Fix ValueError messages in asyncio.Barrier and threading.Barrier (#129419)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
1 parent a472244 commit bcb25d6

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Lib/asyncio/locks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class Barrier(mixins._LoopBoundMixin):
485485
def __init__(self, parties):
486486
"""Create a barrier, initialised to 'parties' tasks."""
487487
if parties < 1:
488-
raise ValueError('parties must be > 0')
488+
raise ValueError('parties must be >= 1')
489489

490490
self._cond = Condition() # notify all tasks when state changes
491491

Lib/threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def __init__(self, parties, action=None, timeout=None):
694694
695695
"""
696696
if parties < 1:
697-
raise ValueError("parties must be > 0")
697+
raise ValueError("parties must be >= 1")
698698
self._cond = Condition(Lock())
699699
self._action = action
700700
self._timeout = timeout
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Corrected :exc:`ValueError` message for :class:`asyncio.Barrier` and :class:`threading.Barrier`.

0 commit comments

Comments
 (0)