blob: a187e930636a56ad32b5150a2b5f0c98e299c4b1 [file] [log] [blame]
srikanth116e6e82014-08-19 07:22:37 -07001https://code.djangoproject.com/changeset/15911
2
3Index: /django/trunk/django/utils/autoreload.py
4===================================================================
5--- /django/trunk/django/utils/autoreload.py (revision 15883)
6+++ /django/trunk/django/utils/autoreload.py (revision 15911)
7@@ -74,9 +74,10 @@
8 def ensure_echo_on():
9 if termios:
10- fd = sys.stdin.fileno()
11- attr_list = termios.tcgetattr(fd)
12- if not attr_list[3] & termios.ECHO:
13- attr_list[3] |= termios.ECHO
14- termios.tcsetattr(fd, termios.TCSANOW, attr_list)
15+ fd = sys.stdin
16+ if fd.isatty():
17+ attr_list = termios.tcgetattr(fd)
18+ if not attr_list[3] & termios.ECHO:
19+ attr_list[3] |= termios.ECHO
20+ termios.tcsetattr(fd, termios.TCSANOW, attr_list)
21
22 def reloader_thread():