Skip to content

[3.13] gh-129403: Fix ValueError messages in asyncio.Barrier and threading.Barrier (GH-129419) #129468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/asyncio/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Lib/threading.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ def __init__(self, parties, action=None, timeout=None):

"""
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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Corrected :exc:`ValueError` message for :class:`asyncio.Barrier` and :class:`threading.Barrier`.
Loading