Skip to content

Commit 56f0784

Browse files
Handle top level exceptions in new pyrepl and prevent of closing it
1 parent 425f60b commit 56f0784

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/_pyrepl/simple_interact.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,8 @@ def maybe_run_command(statement: str) -> bool:
158158
except MemoryError:
159159
console.write("\nMemoryError\n")
160160
console.resetbuffer()
161+
except SystemExit:
162+
break
163+
except:
164+
console.showtraceback()
165+
console.resetbuffer()

0 commit comments

Comments
 (0)