From a579720005cbaab17a19a47d239623a95e2036ce Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Wed, 2 Nov 2022 09:38:38 +0200 Subject: Replace %/.format/concatenation with f-strings where feasible Original conversion suggestions via flynt, edited by hand. --- babel/lists.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'babel/lists.py') diff --git a/babel/lists.py b/babel/lists.py index 11cc7d7..ea983ef 100644 --- a/babel/lists.py +++ b/babel/lists.py @@ -68,11 +68,10 @@ def format_list(lst, style='standard', locale=DEFAULT_LOCALE): return lst[0] if style not in locale.list_patterns: - raise ValueError('Locale %s does not support list formatting style %r (supported are %s)' % ( - locale, - style, - list(sorted(locale.list_patterns)), - )) + raise ValueError( + f'Locale {locale} does not support list formatting style {style!r} ' + f'(supported are {sorted(locale.list_patterns)})' + ) patterns = locale.list_patterns[style] if len(lst) == 2: -- cgit v1.2.1