def __init__(self, capture_stdout: bool=False, capture_stderr: bool=False,<EOL>capture_exceptions: Union[bool, Callable[[BaseException], bool]]=False,<EOL>capture_exception: bool=_CAPTURE_EXCEPTION_SENTINEL):
if capture_exception != _CAPTURE_EXCEPTION_SENTINEL:<EOL><INDENT>if capture_exceptions:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>capture_exceptions = capture_exception<EOL><DEDENT>self.capture_stdout = capture_stdout<EOL>self.capture_stderr = capture_stderr<EOL>self._capture_exceptions = None<EOL>self.capture_exceptions = capture_exceptions<EOL>
Constructor.
:param capture_stdout: whether to capture the content on stdout
:param capture_stderr: whether to capture the content on sterr
:param capture_exceptions: whether to capture exceptions (returns on an exception, oppose to raising the
exception) or, more specifically, to capture an exception if a given callable dictates (else let it raise).
Useful for capturing `SystemExit(code=0)`