mirror of
https://github.com/django/django.git
synced 2025-07-05 18:29:11 +00:00
[1.2.X] Ensure stdin is a tty before handing it to termios, so as to prevent prolems when running under IDEs.
r15911 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c5b476e22a
commit
1dc518555b
@ -73,11 +73,12 @@ def code_changed():
|
|||||||
|
|
||||||
def ensure_echo_on():
|
def ensure_echo_on():
|
||||||
if termios:
|
if termios:
|
||||||
fd = sys.stdin.fileno()
|
fd = sys.stdin
|
||||||
attr_list = termios.tcgetattr(fd)
|
if fd.isatty():
|
||||||
if not attr_list[3] & termios.ECHO:
|
attr_list = termios.tcgetattr(fd)
|
||||||
attr_list[3] |= termios.ECHO
|
if not attr_list[3] & termios.ECHO:
|
||||||
termios.tcsetattr(fd, termios.TCSANOW, attr_list)
|
attr_list[3] |= termios.ECHO
|
||||||
|
termios.tcsetattr(fd, termios.TCSANOW, attr_list)
|
||||||
|
|
||||||
def reloader_thread():
|
def reloader_thread():
|
||||||
ensure_echo_on()
|
ensure_echo_on()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user