def _transfer_result(fut1, fut2):
exc = fut1.get_exception()<EOL>if exc is not None:<EOL><INDENT>tb = fut1.get_traceback()<EOL>fut2.set_exception(exc, tb)<EOL><DEDENT>else:<EOL><INDENT>val = fut1.get_result()<EOL>fut2.set_result(val)<EOL><DEDENT>
Helper to transfer result or errors from one Future to another.