Merge pull request #1593 from davisagli/fix.reloader-non-tty-backport
1.5 backport: only reset terminal echo flag if stdin is a tty
| | |
| | | 1.5.4 (unreleased) |
| | | ================== |
| | | |
| | | - Fix regression where ``pserve --reload`` would not work when running |
| | | as a daemon. |
| | | Backported from https://github.com/Pylons/pyramid/pull/1592 |
| | | |
| | | .. _changes_1.5.3: |
| | | |
| | | 1.5.3 (2015-02-22) |
| | |
| | | |
| | | def ensure_echo_on(): # pragma: no cover |
| | | if termios: |
| | | fd = sys.stdin.fileno() |
| | | attr_list = termios.tcgetattr(fd) |
| | | if not attr_list[3] & termios.ECHO: |
| | | attr_list[3] |= termios.ECHO |
| | | termios.tcsetattr(fd, termios.TCSANOW, attr_list) |
| | | fd = sys.stdin |
| | | if fd.isatty(): |
| | | attr_list = termios.tcgetattr(fd) |
| | | if not attr_list[3] & termios.ECHO: |
| | | attr_list[3] |= termios.ECHO |
| | | termios.tcsetattr(fd, termios.TCSANOW, attr_list) |
| | | |
| | | def install_reloader(poll_interval=1, extra_files=None): # pragma: no cover |
| | | """ |