Make an context is task-local.

This commit is contained in:
Alex Root Junior 2017-12-10 03:40:09 +02:00
parent 115f1fe032
commit 154c12a165

View file

@ -31,7 +31,7 @@ def task_factory(loop: asyncio.BaseEventLoop, coro: typing.Coroutine):
del task._source_traceback[-1]
try:
task.context = asyncio.Task.current_task().context
task.context = asyncio.Task.current_task().context.copy()
except AttributeError:
task.context = {CONFIGURED: True}