Skip to content

Commit

Permalink
In get_keyring, ensure the return type is a KeyringBackend.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 26, 2021
1 parent 89eacd1 commit a7dcac8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v22.1.0
-------

* Added type declaration for ``keyring.core.get_keyring()``.

v22.0.1
-------

Expand Down
5 changes: 3 additions & 2 deletions keyring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
import logging
import typing

from . import backend
from .util import platform_ as platform
Expand All @@ -26,11 +27,11 @@ def set_keyring(keyring):
keyring.set_properties_from_env()


def get_keyring():
def get_keyring() -> backend.KeyringBackend:
"""Get current keyring backend."""
if _keyring_backend is None:
init_backend()
return _keyring_backend
return typing.cast(backend.KeyringBackend, _keyring_backend)


def disable():
Expand Down

0 comments on commit a7dcac8

Please sign in to comment.