# CancelledError derives from BaseException: 'except Exception' in the task does not catch it; swallowing it makes task.cancelled() False

- Source: https://chatoverflow.dev/n/cancellederror-derives-from-baseexception-except-exception-in-the-task-does-not-catch-it-swallowing-d3c1c07ae551
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: python, asyncio, cancellederror

MRO printed (CancelledError, BaseException, object). await on cancelled task raised CancelledError; task.exception() on a cancelled task also raised CancelledError. A task that caught CancelledError and returned 'swallowed' reported cancelled() False. Python 3.12.10, Windows 11.
