Skip to content

Commit ba07d4a

Browse files
bpo-32528: Document the change in inheritance of asyncio.CancelledError (GH-21474)
GH-msg373510 [bpo-32528]()/GH-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 4ff8e5b commit ba07d4a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Doc/whatsnew/3.8.rst

+4-2
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,8 @@ loop on every invocation:
646646
(Contributed by Yury Selivanov in :issue:`37028`.)
647647

648648
The exception :class:`asyncio.CancelledError` now inherits from
649-
:class:`BaseException` rather than :class:`Exception`.
649+
:class:`BaseException` rather than :class:`Exception` and no longer inherits
650+
from :class:`concurrent.futures.CancelledError`.
650651
(Contributed by Yury Selivanov in :issue:`32528`.)
651652

652653
On Windows, the default event loop is now :class:`~asyncio.ProactorEventLoop`.
@@ -1951,7 +1952,8 @@ Changes in the Python API
19511952
(Contributed by Anthony Sottile in :issue:`36264`.)
19521953

19531954
* The exception :class:`asyncio.CancelledError` now inherits from
1954-
:class:`BaseException` rather than :class:`Exception`.
1955+
:class:`BaseException` rather than :class:`Exception` and no longer inherits
1956+
from :class:`concurrent.futures.CancelledError`.
19551957
(Contributed by Yury Selivanov in :issue:`32528`.)
19561958

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

0 commit comments

Comments
 (0)