Kaydet (Commit) ef0056ae authored tarafından Guido van Rossum's avatar Guido van Rossum

When sys.stdin.fileno() doesn't work, fall back to default_getpass()

-- don't just die.
üst 5fb2631f
...@@ -29,7 +29,10 @@ def getpass(prompt='Password: '): ...@@ -29,7 +29,10 @@ def getpass(prompt='Password: '):
else: else:
return win_getpass(prompt) 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 old = termios.tcgetattr(fd) # a copy to save
new = old[:] new = old[:]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment