Skip to content

Commit

Permalink
Merge pull request #582 from takluyver/patch-1
Browse files Browse the repository at this point in the history
Let devpi fall back to other options if keyring fails
  • Loading branch information
jaraco committed Jul 14, 2022
2 parents e960542 + 314c8d3 commit 278c108
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
@@ -1,3 +1,8 @@
v23.7.0
-------

* #582: Suppress KeyringErrors for devpi client.

v23.6.0
-------

Expand Down
8 changes: 8 additions & 0 deletions keyring/devpi_client.py
@@ -1,11 +1,19 @@
import contextlib

from pluggy import HookimplMarker

import keyring
from keyring.errors import KeyringError


hookimpl = HookimplMarker("devpiclient")


# https://github.com/jaraco/jaraco.context/blob/c3a9b739/jaraco/context.py#L205
suppress = type('suppress', (contextlib.suppress, contextlib.ContextDecorator), {})


@hookimpl()
@suppress(KeyringError)
def devpiclient_get_password(url, username):
return keyring.get_password(url, username)

0 comments on commit 278c108

Please sign in to comment.