Skip to content

Commit

Permalink
fix: remove exception when keyring is locked python-poetry#1917
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthieuBizien authored and real-yfprojects committed Aug 13, 2023
1 parent 2b16b2f commit 9e47cd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/poetry/utils/password_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ def get_credential(
import keyring

for name in names:
credential = keyring.get_credential(name, username)
try:
credential = keyring.get_credential(name, username)
except keyring.errors.KeyringLocked:
logger.debug("Keyring %s is locked", name)
credential = None
if credential:
return HTTPAuthCredential(
username=credential.username, password=credential.password
Expand Down

0 comments on commit 9e47cd9

Please sign in to comment.