diff --git a/Lib/getpass.py b/Lib/getpass.py index be7a2f9049b..f0aea63ac34 100644 --- a/Lib/getpass.py +++ b/Lib/getpass.py @@ -29,7 +29,10 @@ def getpass(prompt='Password: '): else: return win_getpass(prompt) - fd = sys.stdin.fileno() + try: + fd = sys.stdin.fileno() + except: + return default_getpass(prompt) old = termios.tcgetattr(fd) # a copy to save new = old[:]