Skip to content
Commit c6d7ac71 authored by Stephen Walker's avatar Stephen Walker
Browse files

pylib: handle stty OSError exception



$ pyntpq -p
Traceback (most recent call last):
  File "/usr/bin/pyntpq", line 1478, in <module>
    interpreter.onecmd(cmd)
  File "/usr/lib/python2.7/cmd.py", line 221, in onecmd
    return func(arg)
  File "/usr/bin/pyntpq", line 1083, in do_peers
    self.__dopeers(showall=False, mode="peers")
  File "/usr/bin/pyntpq", line 282, in __dopeers
    self.wideremote)
  File "/usr/lib/python2.7/site-packages/ntp/util.py", line 63, in __init__
    self.horizontal_slack = termsize()[1] - 80
  File "/usr/lib/python2.7/site-packages/ntp/util.py", line 44, in termsize
    output = subprocess.check_output(shlex.split('/bin/stty -a'))
  File "/usr/lib/python2.7/subprocess.py", line 567, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Signed-off-by: default avatarStephen Walker <stephendwalker+github@gmail.com>
parent 7ffa6144
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment