This commit is contained in:
Kovid Goyal 2025-07-09 08:37:57 +05:30
parent 7e88bac83a
commit f5b3f6aa0e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -3493,7 +3493,7 @@ For example, the selector:
def repl(mo): def repl(mo):
txt = mo.group() txt = mo.group()
fmt_char = txt[1] fmt_char = txt[1]
suffixes = re.split('\|', txt[3:-1]) suffixes = re.split(r'\|', txt[3:-1])
match len(suffixes): match len(suffixes):
case 1 if not suffixes[0]: case 1 if not suffixes[0]:
zero_suffix = one_suffix = more_suffix = fmt_char.lower() + ' ' zero_suffix = one_suffix = more_suffix = fmt_char.lower() + ' '
@ -3537,7 +3537,7 @@ For example, the selector:
case _: case _:
raise ValueError(_('The {} format specifier is not valid').format(fmt_char)) raise ValueError(_('The {} format specifier is not valid').format(fmt_char))
s = re.sub('{.:?.*?}', repl, template) s = re.sub(r'{.:?.*?}', repl, template)
return s return s