From ec5d502f24c1bb1b3b7be700ec2a4008d58b3b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Wed, 16 Feb 2022 13:22:10 +0100 Subject: [PATCH] Use f-strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio_omemo/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/poezio_omemo/__init__.py b/poezio_omemo/__init__.py index b5967dc..f90473c 100644 --- a/poezio_omemo/__init__.py +++ b/poezio_omemo/__init__.py @@ -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