diff --git a/keyring/backends/SecretService.py b/keyring/backends/SecretService.py index 07810fef..9b180bb5 100644 --- a/keyring/backends/SecretService.py +++ b/keyring/backends/SecretService.py @@ -45,7 +45,7 @@ def priority(cls) -> float: "activatable through D-Bus" ) except exceptions.SecretStorageException as e: - raise RuntimeError("Unable to initialize SecretService: %s" % e) from e + raise RuntimeError(f"Unable to initialize SecretService: {e}") from e return 5 def get_preferred_collection(self): @@ -60,7 +60,7 @@ def get_preferred_collection(self): else: collection = secretstorage.get_default_collection(bus) except exceptions.SecretStorageException as e: - raise InitError("Failed to create the collection: %s." % e) from e + raise InitError(f"Failed to create the collection: {e}.") from e if collection.is_locked(): collection.unlock() if collection.is_locked(): # User dismissed the prompt diff --git a/keyring/backends/kwallet.py b/keyring/backends/kwallet.py index c1a4a77d..541d25ea 100644 --- a/keyring/backends/kwallet.py +++ b/keyring/backends/kwallet.py @@ -96,7 +96,7 @@ def connected(self, service): self.iface = dbus.Interface(remote_obj, 'org.kde.KWallet') self.handle = self.iface.open(self.iface.networkWallet(), wId, self.appid) except dbus.DBusException as e: - raise InitError('Failed to open keyring: %s.' % e) from e + raise InitError(f'Failed to open keyring: {e}.') from e if self.handle < 0: return False diff --git a/keyring/credentials.py b/keyring/credentials.py index 8872bf31..713a9dbe 100644 --- a/keyring/credentials.py +++ b/keyring/credentials.py @@ -58,7 +58,7 @@ def _get_env(self, env_var): """Helper to read an environment variable""" value = os.environ.get(env_var) if not value: - raise ValueError('Missing environment variable:%s' % env_var) + raise ValueError(f'Missing environment variable:{env_var}') return value @property