From fd207da67c69bca03dc1bdf04a43c88d9c7dd04c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 25 May 2023 08:33:02 +0530 Subject: [PATCH] Fix use of _ as local variable and gettext in same scope --- src/calibre/utils/formatter_functions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index 814c314139..0bfd0cb000 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -822,11 +822,11 @@ class BuiltinIdentifierInList(BuiltinFormatterFunction): raise ValueError(_("{} requires 2 or 4 arguments").format(self.name)) l = [v.strip() for v in val.split(',') if v.strip()] - (id_, _, regexp) = ident.partition(':') + (id_, __, regexp) = ident.partition(':') if not id_: return nfv for candidate in l: - i, _, v = candidate.partition(':') + i, __, v = candidate.partition(':') if v and i == id_: if not regexp or re.search(regexp, v, flags=re.I): return candidate if fv_is_id else fv