From: Neal Norwitz Date: Wed, 20 Nov 2002 23:38:20 +0000 (+0000) Subject: Backport fix for SF #640094, on win32 getpass runs into unix_getpass X-Git-Tag: v2.2.3c1~219 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9dbd177d051a64da4070c2f422fb7bacbe82057f;p=thirdparty%2FPython%2Fcpython.git Backport fix for SF #640094, on win32 getpass runs into unix_getpass Make sure we have a UNIX-compatible termios. Apparently, McMillan Installer made a termios on windows which caused unix_getpass to be used instead of win_getpass --- diff --git a/Lib/getpass.py b/Lib/getpass.py index eefb1f955897..e96491f90bfe 100644 --- a/Lib/getpass.py +++ b/Lib/getpass.py @@ -104,7 +104,10 @@ def getuser(): # Bind the name getpass to the appropriate function try: import termios -except ImportError: + # it's possible there is an incompatible termios from the + # McMillan Installer, make sure we have a UNIX-compatible termios + termios.tcgetattr, termios.tcsetattr +except (ImportError, AttributeError): try: import msvcrt except ImportError: