call the given function with args/kwargs
and return a (res, out, err) tuple where
out and err represent the output/error output
during function execution.
def callcapture(func, *args, **kwargs):
origin:<UNKNOWN>
where:
function source:
def callcapture(func, *args, **kwargs):
""" call the given function with args/kwargs
and return a (res, out, err) tuple where
out and err represent the output/error output
during function execution.
"""
so = OutErrCapture()
try:
res = func(*args, **kwargs)
finally:
out, err = so.reset()
return res, out, err
called in /home/fijal/lang/python/pypy-dist/py/io/test/test_capture.py