Skip to content

Commit 87b14c8

Browse files
[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 <[email protected]>
1 parent f371b23 commit 87b14c8

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)