]> granicus.if.org Git - python/commitdiff
Get the needed constants from termios, not TERMIOS.
authorFred Drake <fdrake@acm.org>
Tue, 27 Feb 2001 21:23:31 +0000 (21:23 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 27 Feb 2001 21:23:31 +0000 (21:23 +0000)
Lib/getpass.py
Lib/tty.py

index 840f7a0ca2f8a43500a70294d3879d8b79d58951..2b1f6b2625b64ccc28407deb55de5f08a203c487 100644 (file)
@@ -30,12 +30,12 @@ def unix_getpass(prompt='Password: '):
     old = termios.tcgetattr(fd)     # a copy to save
     new = old[:]
 
-    new[3] = new[3] & ~TERMIOS.ECHO # 3 == 'lflags'
+    new[3] = new[3] & ~termios.ECHO # 3 == 'lflags'
     try:
-        termios.tcsetattr(fd, TERMIOS.TCSADRAIN, new)
+        termios.tcsetattr(fd, termios.TCSADRAIN, new)
         passwd = _raw_input(prompt)
     finally:
-        termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old)
+        termios.tcsetattr(fd, termios.TCSADRAIN, old)
 
     sys.stdout.write('\n')
     return passwd
@@ -103,7 +103,7 @@ def getuser():
 
 # Bind the name getpass to the appropriate function
 try:
-    import termios, TERMIOS
+    import termios
 except ImportError:
     try:
         import msvcrt
index b76a6170b71494ab667387d582c561d9dc945fff..b1904fb5052ca8d6a116263343dff88c14956f64 100644 (file)
@@ -2,7 +2,6 @@
 
 # Author: Steen Lumholt.
 
-from TERMIOS import *
 from termios import *
 
 # Indexes for termios list.