[Async-sig] killing tasks that won't cancel

Andrew Svetlov andrew.svetlov at gmail.com
Tue Feb 19 15:10:07 EST 2019


If the task's function swallows CancelledError exception -- it is a
programming error.
The same as generator object technically can swallow GeneratorExit
(but such code is most likely buggy).

On Tue, Feb 19, 2019 at 9:55 PM Chris Jerdonek <chris.jerdonek at gmail.com> wrote:
>
> I have an asyncio question.
>
> In Python 3.7, is there a way to reliably end a task after having
> already tried calling cancel() on it and waiting for it to end?
>
> In Python 3.6, I did this with task.set_exception(), but in 3.7 that
> method was removed.
>
> --Chris
> _______________________________________________
> Async-sig mailing list
> Async-sig at python.org
> https://mail.python.org/mailman/listinfo/async-sig
> Code of Conduct: https://www.python.org/psf/codeofconduct/



-- 
Thanks,
Andrew Svetlov


More information about the Async-sig mailing list