https://github.com/python/cpython/commit/87b14c8f21bbd675a98f0ae02149d8376e8f8d3d
commit: 87b14c8f21bbd675a98f0ae02149d8376e8f8d3d
branch: 3.13
author: Ɓukasz Langa <luk...@langa.pl>
committer: ambv <luk...@langa.pl>
date: 2025-05-05T17:20:54+02:00
summary:

[3.13] gh-131878: Handle top level exceptions in new pyrepl and prevent of 
closing it (GH-131910) (GH-133445)

Co-authored-by: Sergey Miryanov <sergey.mirya...@gmail.com>

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 c6f40abfab4226..8148b19a942eb7 100644
--- a/Lib/_pyrepl/simple_interact.py
+++ b/Lib/_pyrepl/simple_interact.py
@@ -163,3 +163,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

Reply via email to