From 08a82a7650e6efaa5b30637908dd4d2382ad02b7 Mon Sep 17 00:00:00 2001 From: Yesha Date: Sat, 25 Jul 2020 16:40:43 -0700 Subject: [PATCH] Password optional if client_cert is set --- twine/settings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twine/settings.py b/twine/settings.py index 73d4608c..d7128687 100644 --- a/twine/settings.py +++ b/twine/settings.py @@ -145,7 +145,10 @@ def username(self) -> Optional[str]: @property def password(self) -> Optional[str]: if self.client_cert: - return None + try: + return cast(Optional[str], self.auth.password) + except exceptions.NonInteractive: + return None # Workaround for https://github.com/python/mypy/issues/5858 return cast(Optional[str], self.auth.password)