mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue