summaryrefslogtreecommitdiffstats
path: root/Lib/getpass.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-30 15:07:44 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-30 15:07:44 (GMT)
commit60250e2859bd1e736e9a741f4c419002f6afcfd6 (patch)
treed359831ae5b107c1c66b9eeea7dcbaa29885b414 /Lib/getpass.py
parent8019913e4a1e8e7716a7c44168c53d52a651fb7c (diff)
downloadcpython-60250e2859bd1e736e9a741f4c419002f6afcfd6.zip
cpython-60250e2859bd1e736e9a741f4c419002f6afcfd6.tar.gz
cpython-60250e2859bd1e736e9a741f4c419002f6afcfd6.tar.bz2
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.
Diffstat (limited to 'Lib/getpass.py')
-rw-r--r--Lib/getpass.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/getpass.py b/Lib/getpass.py
index e811890..eefb1f9 100644
--- a/Lib/getpass.py
+++ b/Lib/getpass.py
@@ -42,6 +42,8 @@ def unix_getpass(prompt='Password: '):
def win_getpass(prompt='Password: '):
"""Prompt for password with echo off, using Windows getch()."""
+ if sys.stdin is not sys.__stdin__:
+ return default_getpass(prompt)
import msvcrt
for c in prompt:
msvcrt.putch(c)