From 117ed8957c22f5f4d7ad02707bce9e8710a19459 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 13:25:27 +0100 Subject: [PATCH 1/3] gh-135074: Fix exception messages in test.support module --- Lib/test/support/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py index 351d832a26d1df..f9b66b88d3d05c 100644 --- a/Lib/test/support/__init__.py +++ b/Lib/test/support/__init__.py @@ -1084,7 +1084,7 @@ def set_memlimit(limit: str) -> None: global real_max_memuse memlimit = _parse_memlimit(limit) if memlimit < _2G - 1: - raise ValueError('Memory limit {limit!r} too low to be useful') + raise ValueError(f'Memory limit {limit!r} too low to be useful') real_max_memuse = memlimit memlimit = min(memlimit, MAX_Py_ssize_t) @@ -2358,7 +2358,7 @@ def infinite_recursion(max_depth=None): # very deep recursion. max_depth = 20_000 elif max_depth < 3: - raise ValueError("max_depth must be at least 3, got {max_depth}") + raise ValueError(f"max_depth must be at least 3, got {max_depth}") depth = get_recursion_depth() depth = max(depth - 1, 1) # Ignore infinite_recursion() frame. limit = depth + max_depth From 44f80c7166945449554aba2a005d15a177b4120c Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 13:27:31 +0100 Subject: [PATCH 2/3] Add blurb --- .../next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst diff --git a/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst b/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst new file mode 100644 index 00000000000000..72be4c78a716b3 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst @@ -0,0 +1,2 @@ +Fix exception messages in the :mod:`test.support` module that were missing +the 'f' prefix. From 8e32112b30b25e7c0c3c71c970e9fc2bf45681b6 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 3 Jun 2025 13:45:14 +0100 Subject: [PATCH 3/3] Revert "Add blurb" This reverts commit 44f80c7166945449554aba2a005d15a177b4120c. --- .../next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst diff --git a/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst b/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst deleted file mode 100644 index 72be4c78a716b3..00000000000000 --- a/Misc/NEWS.d/next/Library/2025-06-03-13-27-23.gh-issue-135074.JMdFEi.rst +++ /dev/null @@ -1,2 +0,0 @@ -Fix exception messages in the :mod:`test.support` module that were missing -the 'f' prefix.