]> granicus.if.org Git - python/commitdiff
win_getpass(): if sys.stdin is not sys.__stdin__, use
authorGuido van Rossum <guido@python.org>
Thu, 30 Aug 2001 15:07:44 +0000 (15:07 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 30 Aug 2001 15:07:44 +0000 (15:07 +0000)
default_getpass().  This should prevent hanging when it is called in
IDLE.

Fixes SF bug #455648.

Lib/getpass.py

index e811890e1e7e83a819d9cf5e488f57435fc73c70..eefb1f955897cb3d8321f9b64f9f59810e530894 100644 (file)
@@ -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)