]> granicus.if.org Git - python/commitdiff
Fix SF #640094, on win32 getpass runs into unix_getpass
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 20 Nov 2002 23:15:54 +0000 (23:15 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 20 Nov 2002 23:15:54 +0000 (23:15 +0000)
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().

Will backport.

Lib/getpass.py

index eefb1f955897cb3d8321f9b64f9f59810e530894..e96491f90bfe2808d14e9f12dc574d7af941ba03 100644 (file)
@@ -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: