[Git][NTPsec/ntpsec][master] Suppress /bin/stty error message thrown by an ssh session.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Nov 28 15:15:41 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
bea67d8f by Eric S. Raymond at 2016-11-28T10:14:46-05:00
Suppress /bin/stty error message thrown by an ssh session.

- - - - -


1 changed file:

- pylib/util.py


Changes:

=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -67,7 +67,7 @@ def termsize():
     # Alternatives at http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
     import shlex, subprocess, re
     try:
-        output = subprocess.check_output(shlex.split('/bin/stty -a'), universal_newlines=True)
+        output = subprocess.check_output(shlex.split('/bin/stty -a 2>/dev/null'), universal_newlines=True)
     except (OSError, subprocess.CalledProcessError, AttributeError):
         return (24, 80)
     for pattern in ('rows\D+(\d+); columns\D+(\d+);', '\s+(\d+)\D+rows;\s+(\d+)\D+columns;'):



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/bea67d8f23c3981dbe661d3df9bbd8c9880e783b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161128/f178a2e3/attachment.html>


More information about the vc mailing list