mirror of
https://github.com/django/django.git
synced 2024-12-01 15:42:04 +01:00
Ensure stdin is a tty before handing it to termios, so as to prevent prolems when running under IDEs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15911 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
f3f1983f30
commit
3e7ce3c750
@ -73,7 +73,8 @@ def code_changed():
|
|||||||
|
|
||||||
def ensure_echo_on():
|
def ensure_echo_on():
|
||||||
if termios:
|
if termios:
|
||||||
fd = sys.stdin.fileno()
|
fd = sys.stdin
|
||||||
|
if fd.isatty():
|
||||||
attr_list = termios.tcgetattr(fd)
|
attr_list = termios.tcgetattr(fd)
|
||||||
if not attr_list[3] & termios.ECHO:
|
if not attr_list[3] & termios.ECHO:
|
||||||
attr_list[3] |= termios.ECHO
|
attr_list[3] |= termios.ECHO
|
||||||
|
Loading…
Reference in New Issue
Block a user