Skip to content

Commit

Permalink
Fall back if the keyring is locked
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Nov 15, 2022
1 parent dbd972a commit 35e8918
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/poetry/utils/password_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,14 @@ def get_credential(
return default

import keyring
import keyring.errors

for name in names:
credential = keyring.get_credential(name, username)
try:
credential = keyring.get_credential(name, username)
except keyring.errors.KeyringLocked:
self._is_available = False
break
if credential:
return HTTPAuthCredential(
username=credential.username, password=credential.password
Expand Down

0 comments on commit 35e8918

Please sign in to comment.