8000 gh-131878: Handle top level exceptions in new pyrepl and prevent of c… · faster-cpython/cpython@99a0d7e · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99a0d7e

Browse files
pythongh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (python#131910)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
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)
0