]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-131878: Handle top level exceptions in new pyrepl and prevent of closing...
authorŁukasz Langa <lukasz@langa.pl>
Mon, 5 May 2025 15:20:54 +0000 (17:20 +0200)
committerGitHub <noreply@github.com>
Mon, 5 May 2025 15:20:54 +0000 (17:20 +0200)
Co-authored-by: Sergey Miryanov <sergey.miryanov@gmail.com>
Lib/_pyrepl/simple_interact.py
Misc/NEWS.d/next/Core and Builtins/2025-03-30-19-58-14.gh-issue-131878.uxM26H.rst [new file with mode: 0644]

index c6f40abfab42262112d142be3b5a5c6458f46bb9..8148b19a942eb7a21153b82996789ab6980fe8d3 100644 (file)
@@ -163,3 +163,8 @@ def run_multiline_interactive_console(
         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 (file)
index 0000000..79b23db
--- /dev/null
@@ -0,0 +1 @@
+Handle uncaught exceptions in the main input loop for the new REPL.