From 22d0941cbadc5c0606ace90d4dcfc2f0fe44ff75 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 28 Jan 2025 20:43:46 +0000 Subject: [PATCH 1/3] Fix Error Messages --- Lib/asyncio/locks.py | 2 +- Lib/threading.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/asyncio/locks.py b/Lib/asyncio/locks.py index f2f8b7ec858096..fa3a94764b507a 100644 --- a/Lib/asyncio/locks.py +++ b/Lib/asyncio/locks.py @@ -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 diff --git a/Lib/threading.py b/Lib/threading.py index 78e591124278fc..cbf3da468b1c1f 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -694,7 +694,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 From 7c2fdae3618967bd7715abd59e4a8cfc71dce3aa Mon Sep 17 00:00:00 2001 From: stan Date: Wed, 29 Jan 2025 17:10:58 +0000 Subject: [PATCH 2/3] Add NEWS --- .../next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst diff --git a/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst b/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst new file mode 100644 index 00000000000000..9484ac31f51511 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst @@ -0,0 +1 @@ +Updated ValueError message for asyncio and threading Barrier. From 2b1319a546da671c04061f4106440b1da8a5cf39 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:38:45 +0000 Subject: [PATCH 3/3] Update Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst Co-authored-by: Peter Bierma --- .../next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst b/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst index 9484ac31f51511..0c2bdd3136e3a3 100644 --- a/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst +++ b/Misc/NEWS.d/next/Library/2025-01-29-17-10-00.gh-issue-129403.314159.rst @@ -1 +1 @@ -Updated ValueError message for asyncio and threading Barrier. +Corrected :exc:`ValueError` message for :class:`asyncio.Barrier` and :class:`threading.Barrier`.