Skip to content

Commit 8b827b4

Browse files
committed
Add missing type annotations
1 parent 42f1887 commit 8b827b4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

twine/utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def password_prompt(prompt_text: str) -> str:
229229
return getpass.getpass(prompt_text)
230230

231231

232-
def get_password_from_keyring(system, username):
232+
def get_password_from_keyring(system: str, username: str) -> Optional[str]:
233233
try:
234234
return keyring.get_password(system, username)
235235
except Exception as exc:
@@ -256,11 +256,15 @@ def password_from_keyring_or_prompt(
256256
)
257257

258258

259-
def raises_noninteractive_exc(message):
259+
def raises_noninteractive_exc(message: str) -> None:
260260
raise exceptions.NonInteractive(message)
261261

262262

263-
def generate_prompt_func_from(prompt_func, prompt_type, non_interactive):
263+
def generate_prompt_func_from(
264+
prompt_func: Callable,
265+
prompt_type: str,
266+
non_interactive: bool = False
267+
) -> Callable:
264268
if non_interactive:
265269
error_message = "Credential not found for {}.".format(prompt_type)
266270
return functools.partial(

0 commit comments

Comments
 (0)