gh-131878: Handle top level exceptions in new pyrepl and prevent of closing it (#131910)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Sergey Miryanov 2025-05-05 07:54:19 -07:00 committed by GitHub
parent 1bc16504ef
commit 99a0d7e5b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -162,3 +162,8 @@ def maybe_run_command(statement: str) -> bool:
except MemoryError:
console.write("\nMemoryError\n")
console.resetbuffer()
except SystemExit:
raise
except:
console.showtraceback()
console.resetbuffer()

View File

@ -0,0 +1 @@
Handle uncaught exceptions in the main input loop for the new REPL.