Skip to content

Commit

Permalink
Replace remaining percent formatting with f-strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 23, 2024
1 parent 400f9dd commit 1b1d172
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions keyring/backends/SecretService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion keyring/backends/kwallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion keyring/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1b1d172

Please sign in to comment.