Skip to content

Commit 1191d01

Browse files
committed
Get the needed constants from termios, not TERMIOS.
1 parent df48d14 commit 1191d01

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/getpass.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ def unix_getpass(prompt='Password: '):
3030
old = termios.tcgetattr(fd) # a copy to save
3131
new = old[:]
3232

33-
new[3] = new[3] & ~TERMIOS.ECHO # 3 == 'lflags'
33+
new[3] = new[3] & ~termios.ECHO # 3 == 'lflags'
3434
try:
35-
termios.tcsetattr(fd, TERMIOS.TCSADRAIN, new)
35+
termios.tcsetattr(fd, termios.TCSADRAIN, new)
3636
passwd = _raw_input(prompt)
3737
finally:
38-
termios.tcsetattr(fd, TERMIOS.TCSADRAIN, old)
38+
termios.tcsetattr(fd, termios.TCSADRAIN, old)
3939

4040
sys.stdout.write('\n')
4141
return passwd
@@ -103,7 +103,7 @@ def getuser():
103103

104104
# Bind the name getpass to the appropriate function
105105
try:
106-
import termios, TERMIOS
106+
import termios
107107
except ImportError:
108108
try:
109109
import msvcrt

Lib/tty.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
# Author: Steen Lumholt.
44

5-
from TERMIOS import *
65
from termios import *
76

87
# Indexes for termios list.

0 commit comments

Comments
 (0)