Merge bf3609700e
into 7b09d8759f
This commit is contained in:
commit
01fdf2678c
|
@ -541,6 +541,16 @@ def ctrl_c(signum, frame):
|
||||||
raise SystemExit('\nCancelling...')
|
raise SystemExit('\nCancelling...')
|
||||||
|
|
||||||
|
|
||||||
|
def sig_pipe(signum, frame):
|
||||||
|
"""Ignore the PIPE signal when trying to output on a closed file handle,
|
||||||
|
and simply exit
|
||||||
|
|
||||||
|
"""
|
||||||
|
global shutdown_event
|
||||||
|
shutdown_event.set()
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
"""Print the version"""
|
"""Print the version"""
|
||||||
|
|
||||||
|
@ -554,6 +564,7 @@ def speedtest():
|
||||||
shutdown_event = threading.Event()
|
shutdown_event = threading.Event()
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, ctrl_c)
|
signal.signal(signal.SIGINT, ctrl_c)
|
||||||
|
signal.signal(signal.SIGPIPE, sig_pipe)
|
||||||
|
|
||||||
description = (
|
description = (
|
||||||
'Command line interface for testing internet bandwidth using '
|
'Command line interface for testing internet bandwidth using '
|
||||||
|
|
Loading…
Reference in New Issue