Use f-strings
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
5db76017ed
commit
ec5d502f24
1 changed files with 4 additions and 4 deletions
|
@ -170,7 +170,7 @@ class Plugin(E2EEPlugin):
|
||||||
# and given a chance to resolve them already.
|
# and given a chance to resolve them already.
|
||||||
self.display_error('I was not able to decrypt the message.')
|
self.display_error('I was not able to decrypt the message.')
|
||||||
except (Exception,) as exn:
|
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
|
raise
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
@ -215,15 +215,15 @@ class Plugin(E2EEPlugin):
|
||||||
for error in exn.errors:
|
for error in exn.errors:
|
||||||
if isinstance(error, MissingBundleException):
|
if isinstance(error, MissingBundleException):
|
||||||
self.display_error(
|
self.display_error(
|
||||||
'Could not find keys for device "%d" of recipient "%s". Skipping.' %
|
f'Could not find keys for device "{error.device}" '
|
||||||
(error.device, error.bare_jid),
|
f'of recipient "{error.bare_jid}". Skipping.'
|
||||||
)
|
)
|
||||||
jid = JID(error.bare_jid)
|
jid = JID(error.bare_jid)
|
||||||
device_list = expect_problems.setdefault(jid, [])
|
device_list = expect_problems.setdefault(jid, [])
|
||||||
device_list.append(error.device)
|
device_list.append(error.device)
|
||||||
except (IqError, IqTimeout) as exn:
|
except (IqError, IqTimeout) as exn:
|
||||||
self.display_error(
|
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
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue