Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60250e2

Browse files
committed
win_getpass(): if sys.stdin is not sys.__stdin__, use
default_getpass(). This should prevent hanging when it is called in IDLE. Fixes SF bug #455648.
1 parent 8019913 commit 60250e2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Lib/getpass.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ def unix_getpass(prompt='Password: '):
4242

4343
def win_getpass(prompt='Password: '):
4444
"""Prompt for password with echo off, using Windows getch()."""
45+
if sys.stdin is not sys.__stdin__:
46+
return default_getpass(prompt)
4547
import msvcrt
4648
for c in prompt:
4749
msvcrt.putch(c)

0 commit comments

Comments
 (0)