Skip to content

Commit db1d1b1

Browse files
bpo-32528: Document the change in inheritance of asyncio.CancelledError (pythonGH-21474)
GH-msg373510 [bpo-32528]()/pythonGH-13528 changed `asyncio.CancelledError` such that it no longer inherits from `concurrent.futures.CancelledError`. As this affects existing code, specifically when catching the latter instead of the former in exception handling, it should be documented in the "What's new in 3.8?" document. Automerge-Triggered-By: @1st1 (cherry picked from commit 2a51818) Co-authored-by: JustAnotherArchivist <[email protected]>
1 parent b4cd77d commit db1d1b1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/whatsnew/3.8.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@ loop on every invocation:
648648
(Contributed by Yury Selivanov in :issue:`37028`.)
649649

650650
The exception :class:`asyncio.CancelledError` now inherits from
651-
:class:`BaseException` rather than :class:`Exception`.
651+
:class:`BaseException` rather than :class:`Exception` and no longer inherits
652+
from :class:`concurrent.futures.CancelledError`.
652653
(Contributed by Yury Selivanov in :issue:`32528`.)
653654

654655
On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.
@@ -1953,7 +1954,8 @@ Changes in the Python API
19531954
(Contributed by Anthony Sottile in :issue:`36264`.)
19541955

19551956
* The exception :class:`asyncio.CancelledError` now inherits from
1956-
:class:`BaseException` rather than :class:`Exception`.
1957+
:class:`BaseException` rather than :class:`Exception` and no longer inherits
1958+
from :class:`concurrent.futures.CancelledError`.
19571959
(Contributed by Yury Selivanov in :issue:`32528`.)
19581960

19591961
* The function :func:`asyncio.wait_for` now correctly waits for cancellation

0 commit comments

Comments
 (0)