mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 13:08:31 +02:00
Deal with locked exceptions elsewhere too
This commit is contained in:
parent
0975e66228
commit
3b83c549ff
1 changed files with 4 additions and 2 deletions
|
@ -186,12 +186,14 @@ def set_keychain(journal_name, password):
|
||||||
if password is None:
|
if password is None:
|
||||||
try:
|
try:
|
||||||
keyring.delete_password("jrnl", journal_name)
|
keyring.delete_password("jrnl", journal_name)
|
||||||
except keyring.errors.PasswordDeleteError:
|
except (keyring.errors.KeyringLocked, keyring.errors.PasswordDeleteError):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
keyring.set_password("jrnl", journal_name, password)
|
keyring.set_password("jrnl", journal_name, password)
|
||||||
except keyring.errors.NoKeyringError:
|
except (keyring.errors.KeyringLocked):
|
||||||
|
pass
|
||||||
|
except (keyring.errors.NoKeyringError):
|
||||||
print(
|
print(
|
||||||
"Keyring backend not found. Please install one of the supported backends by visiting: https://pypi.org/project/keyring/",
|
"Keyring backend not found. Please install one of the supported backends by visiting: https://pypi.org/project/keyring/",
|
||||||
file=sys.stderr,
|
file=sys.stderr,
|
||||||
|
|
Loading…
Add table
Reference in a new issue