Skip to content

Commit b75310d

Browse files
sergey-miryanovambv
andcommitted
[3.13] pythongh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (pythonGH-131910)
(cherry picked from commit 99a0d7e) Co-authored-by: Sergey Miryanov <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
1 parent f371b23 commit b75310d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,8 @@ def maybe_run_command(statement: str) -> bool:
163163
except MemoryError:
164164
console.write("\nMemoryError\n")
165165
console.resetbuffer()
166+
except SystemExit:
167+
raise
168+
except:
169+
console.showtraceback()
170+
console.resetbuffer()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Handle uncaught exceptions in the main input loop for the new REPL.

0 commit comments

Comments
 (0)