]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-135074: Fix exception messages in test.support module (GH-135076) (GH-135130)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 4 Jun 2025 13:22:02 +0000 (15:22 +0200)
committerGitHub <noreply@github.com>
Wed, 4 Jun 2025 13:22:02 +0000 (13:22 +0000)
(cherry picked from commit bc00ce941e03347dade3faa8822f19836b5bbfe4)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Lib/test/support/__init__.py

index f4cc51a918758728082692c1b81430778df2ae64..7543c833ddb3dffcf0ec5e35733ba8478270f7d9 100644 (file)
@@ -1059,7 +1059,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)
@@ -2295,7 +2295,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