Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

> But, once the asyncio.Task is cancelled, is impossible to retrieve that 
> original asyncio.CancelledError(msg) exception with the message, because it 
> seems that *a new* asyncio.CancelledError() [without the message] is raised 
> when asyncio.Task.result() or asyncio.Task.exception() methods are called.

You say it's "impossible", but isn't the message accessible via the exception 
chain (and visible in the traceback)? One benefit of not duplicating the 
message on the internal call to cancel() is that it makes it easier to pinpoint 
which CancelledError object is associated with the user's call to cancel(), and 
which is associated with the call done by asyncio internals, which is a 
different cancellation. Another benefit is that it prevents info from being 
duplicated in the traceback.

----------
nosy: +chris.jerdonek

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

Reply via email to