]> granicus.if.org Git - python/commitdiff
When sys.stdin.fileno() doesn't work, fall back to default_getpass()
authorGuido van Rossum <guido@python.org>
Mon, 21 Sep 1998 20:00:35 +0000 (20:00 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 21 Sep 1998 20:00:35 +0000 (20:00 +0000)
-- don't just die.

Lib/getpass.py

index be7a2f9049b769aa51148088b0410f505ed8b228..f0aea63ac34930ef49d19acbaea0a0a9d2daf4fe 100644 (file)
@@ -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[:]