From 43abcf01b155a86276727a0a5900f54dc9e74ae6 Mon Sep 17 00:00:00 2001 From: Judah Rand <17158624+judahrand@users.noreply.github.com> Date: Wed, 9 Nov 2022 22:51:24 +0000 Subject: [PATCH] Set `keyring` correctly --- src/pip/_internal/network/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pip/_internal/network/auth.py b/src/pip/_internal/network/auth.py index 0993fc112a4..6f011e1aa65 100644 --- a/src/pip/_internal/network/auth.py +++ b/src/pip/_internal/network/auth.py @@ -63,9 +63,9 @@ def set_password(cls, service_name: str, username: str, password: str) -> None: try: import keyring except ImportError: + keyring = None # type: ignore[assignment] if shutil.which("keyring") is not None: keyring = KeyRingCli # type: ignore[assignment] - keyring = None # type: ignore[assignment] except Exception as exc: logger.warning( "Keyring is skipped due to an exception: %s",