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.jerdo...@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@python.org > https://mail.python.org/mailman/listinfo/async-sig > Code of Conduct: https://www.python.org/psf/codeofconduct/ -- Thanks, Andrew Svetlov _______________________________________________ Async-sig mailing list Async-sig@python.org https://mail.python.org/mailman/listinfo/async-sig Code of Conduct: https://www.python.org/psf/codeofconduct/