def _ctrl_c_handler(signal, frame): # Set error and exception handlers to be quiet. import error error.set_stderr_handler(lambda line, op, input, thread: None) error.set_exception_handler(lambda exception, op, input, thread: None) # kill spawned processes (including remote) spawn.kill_all_processes()
def set_exception_handler(handler): """Replaces the standard exception handler (which prints to stderr). An exception handler takes these arguments: - C{exception}: The exception being handled. - C{op}: The operation that caused the exception. - C{input}: The input to the operation that caused the exception. - C{host}: The host on which the exception occurred (in case of remote execution). """ error.set_exception_handler(handler)