From e6ae44b5d4fcd4f3c4ba10caa72553643c8abc8a Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 17 Mar 2023 17:10:47 +0100 Subject: [PATCH] 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. --- cheroot/workers/threadpool.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cheroot/workers/threadpool.py b/cheroot/workers/threadpool.py index faebdcce55..3437d9bda9 100644 --- a/cheroot/workers/threadpool.py +++ b/cheroot/workers/threadpool.py @@ -161,22 +161,21 @@ def __init__( :raises TypeError: if the max is not an integer or inf """ if min < 1: - raise ValueError('min={} must be > 0'.format(min)) + raise ValueError(f'min={min!s} must be > 0') if max == float('inf'): pass elif not isinstance(max, int) or max == 0: raise TypeError( 'Expected an integer or the infinity value for the `max` ' - 'argument but got {!r}.'.format(max), + f'argument but got {max!r}.', ) elif max < 0: max = float('inf') if max < min: raise ValueError( - 'max={} must be > min={} (or infinity for no max)' - ''.format(max, min), + f'max={max!s} must be > min={min!s} (or infinity for no max)', ) self.server = server