Windows. If sys.stdin doesn't appear to be a real file (characterized
by having a working fileno()), don't use any console specific methods
-- go straight to the default.
"""
import sys
+ try:
+ fd = sys.stdin.fileno()
+ except:
+ return default_getpass(prompt)
try:
import termios, TERMIOS
except ImportError:
else:
return win_getpass(prompt)
- try:
- fd = sys.stdin.fileno()
- except:
- return default_getpass(prompt)
old = termios.tcgetattr(fd) # a copy to save
new = old[:]