Capture the outcome of Python function calls. Extracted from the Trio project.