https://github.com/python/cpython/commit/99a0d7e5b3c6e80f5b9b0ec88ae439d6d620253c commit: 99a0d7e5b3c6e80f5b9b0ec88ae439d6d620253c branch: main author: Sergey Miryanov <sergey.mirya...@gmail.com> committer: ambv <luk...@langa.pl> date: 2025-05-05T16:54:19+02:00 summary:
gh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (#131910) Co-authored-by: Ćukasz Langa <luk...@langa.pl> files: A Misc/NEWS.d/next/Core_and_Builtins/2025-03-30-19-58-14.gh-issue-131878.uxM26H.rst M Lib/_pyrepl/simple_interact.py diff --git a/Lib/_pyrepl/simple_interact.py b/Lib/_pyrepl/simple_interact.py index e2274629b651b9..b3848833e14208 100644 --- a/Lib/_pyrepl/simple_interact.py +++ b/Lib/_pyrepl/simple_interact.py @@ -162,3 +162,8 @@ def maybe_run_command(statement: str) -> bool: except MemoryError: console.write("\nMemoryError\n") console.resetbuffer() + except SystemExit: + raise + except: + console.showtraceback() + console.resetbuffer() diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-03-30-19-58-14.gh-issue-131878.uxM26H.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-03-30-19-58-14.gh-issue-131878.uxM26H.rst new file mode 100644 index 00000000000000..79b23db6d0b79e --- /dev/null +++ b/Misc/NEWS.d/next/Core_and_Builtins/2025-03-30-19-58-14.gh-issue-131878.uxM26H.rst @@ -0,0 +1 @@ +Handle uncaught exceptions in the main input loop for the new REPL. _______________________________________________ Python-checkins mailing list -- python-checkins@python.org To unsubscribe send an email to python-checkins-le...@python.org https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: arch...@mail-archive.com