Andrew Svetlov <andrew.svet...@gmail.com> added the comment:

This is the expected behavior.

asyncio.ensure_future() returns not a future but a task for your case.
Task cancellation requires at least one context switch to finish the task.

P.S.
I suggest replacing `asyncio.ensure_future()` with `asyncio.create_task()` to 
avoid confusion.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37202>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to