mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Unittest - CommandError exception treats SIGABRT specially
* SIGABRT will be used to signal processes that failed to finish after the process assigned time (default 1 second).
This commit is contained in:
parent
04f5f7e2a8
commit
7f9148efb4
1 changed files with 8 additions and 2 deletions
|
@ -1,11 +1,17 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import signal
|
||||
|
||||
|
||||
class CommandError(Exception):
|
||||
def __init__(self, cmd, code, out, err, msg=None):
|
||||
if msg is None:
|
||||
self.msg = ("Command '{0}' finished with unexpected exit code "
|
||||
"'{1}':\nStdout: '{2}'\nStderr: '{3}'")
|
||||
if code == signal.SIGABRT:
|
||||
self.msg = ("Command '{0}' was aborted, likely due to not "
|
||||
"finishing in due time. The exit code was "
|
||||
"'{1}':\nStdout: '{2}'\nStderr: '{3}'")
|
||||
else:
|
||||
self.msg = ("Command '{0}' finished with unexpected exit code "
|
||||
"'{1}':\nStdout: '{2}'\nStderr: '{3}'")
|
||||
else:
|
||||
self.msg = msg
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue