Skip to content

Commit

Permalink
Inline the suppress decorator from jaraco.context.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 14, 2022
1 parent 8858582 commit 314c8d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions keyring/devpi_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
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):
with contextlib.suppress(KeyringError):
return keyring.get_password(url, username)
return keyring.get_password(url, username)

0 comments on commit 314c8d3

Please sign in to comment.