diff options
| author | David Glick <david@glicksoftware.com> | 2015-02-24 15:33:16 -0800 |
|---|---|---|
| committer | David Glick <david@glicksoftware.com> | 2015-02-24 15:33:16 -0800 |
| commit | 5b8d1e69fa6035a32e3167f48b328b29a1568991 (patch) | |
| tree | 0a3374cce3fe548ee153785802a8398ea0191e6d | |
| parent | 5080a3ffcf39ed1ea6ca9b8076eea445f23b80d5 (diff) | |
| download | pyramid-5b8d1e69fa6035a32e3167f48b328b29a1568991.tar.gz pyramid-5b8d1e69fa6035a32e3167f48b328b29a1568991.tar.bz2 pyramid-5b8d1e69fa6035a32e3167f48b328b29a1568991.zip | |
only reset terminal echo flag if stdin is a tty
| -rw-r--r-- | pyramid/scripts/pserve.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py index d68075e01..57e4ab012 100644 --- a/pyramid/scripts/pserve.py +++ b/pyramid/scripts/pserve.py @@ -716,11 +716,12 @@ def _turn_sigterm_into_systemexit(): # pragma: no cover 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 """ |
