- def __init__(self, command, status, stdout, stderr):
- strerror = ["Command failed (%d):\n %s\n" % (status, stderr),
- "while executing\n %s" % command]
- Exception.__init__(self, "\n".join(strerror))
+ """Represent errors in command execution.
+
+ Instances are picklable (for passing through `multiprocessing.Queue`\s).
+
+ >>> import pickle
+ >>> a = CommandError('somefunc', 1, '', 'could not find "somefunc"')
+ >>> x = pickle.dumps(a)
+ >>> b = pickle.loads(x)
+ >>> print b
+ Command failed (1):
+ could not find "somefunc"
+ <BLANKLINE>
+ while executing
+ somefunc
+ >>> print repr(b) # doctest: +NORMALIZE_WHITESPACE
+ CommandError(command='somefunc', status=1, stdout='',
+ stderr='could not find "somefunc"')
+ """
+ def __init__(self, command=None, status=None, stdout=None, stderr=None):