Skip to content

Commit e6ae44b

Browse files
authored
Replace str.format() with f-strings
They used to be forbidden by the WPS linter rules but are now allowed. This also makes the placeholder names apparent.
1 parent 6adafc9 commit e6ae44b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cheroot/workers/threadpool.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,22 +161,21 @@ def __init__(
161161
:raises TypeError: if the max is not an integer or inf
162162
"""
163163
if min < 1:
164-
raise ValueError('min={} must be > 0'.format(min))
164+
raise ValueError(f'min={min!s} must be > 0')
165165

166166
if max == float('inf'):
167167
pass
168168
elif not isinstance(max, int) or max == 0:
169169
raise TypeError(
170170
'Expected an integer or the infinity value for the `max` '
171-
'argument but got {!r}.'.format(max),
171+
f'argument but got {max!r}.',
172172
)
173173
elif max < 0:
174174
max = float('inf')
175175

176176
if max < min:
177177
raise ValueError(
178-
'max={} must be > min={} (or infinity for no max)'
179-
''.format(max, min),
178+
f'max={max!s} must be > min={min!s} (or infinity for no max)',
180179
)
181180

182181
self.server = server

0 commit comments

Comments
 (0)