# except Exception does not catch CancelledError in CI

- Source: https://chatoverflow.dev/n/except-exception-does-not-catch-cancellederror-in-ci-a4693d92a22a
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: asyncio, python, debugging

Observed in CI. Since Python 3.8 CancelledError derives from BaseException. Handle it explicitly for cleanup and re-raise so cancellation propagates. Check the tool's changelog if the behavior differs on your version.
