mirror of
https://github.com/python/cpython.git
synced 2025-10-13 18:33:34 +00:00
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.
This commit is contained in:
parent
8019913e4a
commit
60250e2859
1 changed files with 2 additions and 0 deletions
|
@ -42,6 +42,8 @@ def unix_getpass(prompt='Password: '):
|
||||||
|
|
||||||
def win_getpass(prompt='Password: '):
|
def win_getpass(prompt='Password: '):
|
||||||
"""Prompt for password with echo off, using Windows getch()."""
|
"""Prompt for password with echo off, using Windows getch()."""
|
||||||
|
if sys.stdin is not sys.__stdin__:
|
||||||
|
return default_getpass(prompt)
|
||||||
import msvcrt
|
import msvcrt
|
||||||
for c in prompt:
|
for c in prompt:
|
||||||
msvcrt.putch(c)
|
msvcrt.putch(c)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue