Skip to content
4 changes: 4 additions & 0 deletions Lib/asyncio/futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ def cancel(self, msg=None):
If the future is already done or cancelled, return False. Otherwise,
change the future's state to cancelled, schedule the callbacks and
return True.
The optional argument *msg* is passed as the argument to the
asyncio.CancelledError exception raised when a cancelled Future
is awaited. It can be any object.
"""
self.__log_traceback = False
if self._state != _PENDING:
Expand Down
Loading