add tag
Put the following in ``:

	while True: pass
except KeyboardInterrupt:

Run with `python`:

$ python

Press `Ctrl+C` to interrupt it:

^CTraceback (most recent call last):
  File "/tmp/", line 3, in <module>
    while True: pass

Why is the error still printed and not captured?

Python version: Python 3.11.3, on Linux.

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.