srikanth | 116e6e8 | 2014-08-19 07:22:37 -0700 | [diff] [blame] | 1 | https://code.djangoproject.com/changeset/15911 |
| 2 | |
| 3 | Index: /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(): |