Feature or enhancement
Proposal:
It's a little confusing now.
❯ python -m asyncio
asyncio REPL 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> raise KeyboardInterrupt
KeyboardInterrupt
>>>
❯ python
Python 3.14.0a4+ (heads/main:7d275611f62, Jan 27 2025, 05:41:56) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> raise KeyboardInterrupt
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
raise KeyboardInterrupt
KeyboardInterrupt
>>>
Two options here:
-
Remove specialcasing of KeyboardInterrupt in the asyncio REPL
|
except BaseException: |
|
if keyboard_interrupted: |
|
self.write("\nKeyboardInterrupt\n") |
|
else: |
|
self.showtraceback() |
-
Specialcase KeyboardInterrupt in the main REPL too, as is in the asyncio REPL
What would you opt for?
Me personally -- 1 (show traceback).
CC @ambv
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs
Feature or enhancement
Proposal:
It's a little confusing now.
Two options here:
Remove specialcasing of
KeyboardInterruptin the asyncio REPLcpython/Lib/asyncio/__main__.py
Lines 73 to 77 in bb5c687
Specialcase
KeyboardInterruptin the main REPL too, as is in the asyncio REPLWhat would you opt for?
Me personally -- 1 (show traceback).
CC @ambv
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Linked PRs