Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #582 from takluyver/patch-1
Let devpi fall back to other options if keyring fails
- Loading branch information
Showing
2 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
v23.7.0 | ||
------- | ||
|
||
* #582: Suppress KeyringErrors for devpi client. | ||
|
||
v23.6.0 | ||
------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |