Skip to content

Commit 0305e86

Browse files
danielhollasmiss-islington
authored andcommitted
pythongh-135074: Fix exception messages in test.support module (pythonGH-135076)
(cherry picked from commit bc00ce9) Co-authored-by: Daniel Hollas <[email protected]>
1 parent d446dbc commit 0305e86

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
@@ -1059,7 +1059,7 @@ def set_memlimit(limit: str) -> None:
10591059
global real_max_memuse
10601060
memlimit = _parse_memlimit(limit)
10611061
if memlimit < _2G - 1:
1062-
raise ValueError('Memory limit {limit!r} too low to be useful')
1062+
raise ValueError(f'Memory limit {limit!r} too low to be useful')
10631063

10641064
real_max_memuse = memlimit
10651065
memlimit = min(memlimit, MAX_Py_ssize_t)
@@ -2295,7 +2295,7 @@ def infinite_recursion(max_depth=None):
22952295
# very deep recursion.
22962296
max_depth = 20_000
22972297
elif max_depth < 3:
2298-
raise ValueError("max_depth must be at least 3, got {max_depth}")
2298+
raise ValueError(f"max_depth must be at least 3, got {max_depth}")
22992299
depth = get_recursion_depth()
23002300
depth = max(depth - 1, 1) # Ignore infinite_recursion() frame.
23012301
limit = depth + max_depth

0 commit comments

Comments
 (0)