]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-135074: Fix exception messages in test.support module (GH-135076)
authorDaniel Hollas <daniel.hollas@bristol.ac.uk>
Wed, 4 Jun 2025 12:58:34 +0000 (13:58 +0100)
committerGitHub <noreply@github.com>
Wed, 4 Jun 2025 12:58:34 +0000 (14:58 +0200)
Lib/test/support/__init__.py

index 351d832a26d1dfc13fce630793bb702dfc089846..f9b66b88d3d05c03a38304f7fd18354f33d98af0 100644 (file)
@@ -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