When sys.stdin.fileno() doesn't work, fall back to default_getpass()
-- don't just die.
This commit is contained in:
parent
5fb2631ff9
commit
ef0056ae1a
|
@ -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[:]
|
||||
|
||||
|
|
Loading…
Reference in New Issue