8000 [3.14] gh-135074: Fix exception messages in test.support module (GH-1… · python/cpython@5008317 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5008317

Browse files
[3.14] gh-135074: Fix exception messages in test.support module (GH-135076) (GH-135129)
(cherry picked from commit bc00ce9) Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
1 parent afe244d commit 5008317

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/test/support/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ def set_memlimit(limit: str) -> None:
10841084
global real_max_memuse
10851085
memlimit = _parse_memlimit(limit)
10861086
if memlimit < _2G - 1:
1087-
raise ValueError('Memory limit {limit!r} too low to be useful')
1087+
raise ValueError(f'Memory limit {limit!r} too low to be useful')
10881088

10891089
real_max_memuse = memlimit
10901090
memlimit = min(memlimit, MAX_Py_ssize_t)
@@ -2359,7 +2359,7 @@ def infinite_recursion(max_depth=None):
23592359
# very deep recursion.
23602360
max_depth = 20_000
23612361
elif max_depth < 3:
2362-
raise ValueError("max_depth must be at least 3, got {max_depth}")
2362+
raise ValueError(f"max_depth must be at least 3, got {max_depth}")
23632363
depth = get_recursion_depth()
23642364
depth = max(depth - 1, 1) # Ignore infinite_recursion() frame.
23652365
limit = depth + max_depth

0 commit comments

Comments
 (0)
0