You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2021. It is now read-only.
Future._copy_state does not copy the traceback and causes the following test to fail in python 2, while passing in python 3:
importpytesttry:
importasyncioexceptImportError:
importtrolliusasasynciodefadd(a, b):
raiseRuntimeError("Fail!") # I should be in the tracebackreturna+bdeftest():
loop=asyncio.get_event_loop()
coro=loop.run_in_executor(None, add, 1, 2)
withpytest.raises(RuntimeError) asexcinfo:
loop.run_until_complete(coro)
statement=str(excinfo.traceback[-1].statement)
assert"I should be in the traceback"instatement
I guess copying the traceback in _copy_state is a bit annoying since concurrent.futures uses Future.exception_info/set_exception_info and asyncio uses Future.exception/_get_exception_tb/_set_exception_with_tb.
Future._copy_state does not copy the traceback and causes the following test to fail in python 2, while passing in python 3:
I guess copying the traceback in
_copy_stateis a bit annoying sinceconcurrent.futuresusesFuture.exception_info/set_exception_infoandasynciousesFuture.exception/_get_exception_tb/_set_exception_with_tb.