Skip to content

Commit 99a0d7e

Browse files
gh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (#131910)
Co-authored-by: Łukasz Langa <[email protected]>
1 parent 1bc1650 commit 99a0d7e

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
@@ -162,3 +162,8 @@ def maybe_run_command(statement: str) -> bool:
162162
except MemoryError:
163163
console.write("\nMemoryError\n")
164164
console.resetbuffer()
165+
except SystemExit:
166+
raise
167+
except:
168+
console.showtraceback()
169+
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)