Use f-strings

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2022-02-16 13:22:10 +01:00
parent 5db76017ed
commit ec5d502f24
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -170,7 +170,7 @@ class Plugin(E2EEPlugin):
# and given a chance to resolve them already.
self.display_error('I was not able to decrypt the message.')
except (Exception,) as exn:
self.display_error('An error occured while attempting decryption.\n%r' % exn)
self.display_error(f'An error occured while attempting decryption.\n{exn}')
raise
return None
@ -215,15 +215,15 @@ class Plugin(E2EEPlugin):
for error in exn.errors:
if isinstance(error, MissingBundleException):
self.display_error(
'Could not find keys for device "%d" of recipient "%s". Skipping.' %
(error.device, error.bare_jid),
f'Could not find keys for device "{error.device}" '
f'of recipient "{error.bare_jid}". Skipping.'
)
jid = JID(error.bare_jid)
device_list = expect_problems.setdefault(jid, [])
device_list.append(error.device)
except (IqError, IqTimeout) as exn:
self.display_error(
'An error occured while fetching information on a recipient.\n%r' % exn,
'An error occured while fetching information on a recipient.\n{exn}'
)
return None