Skip to content

Commit 042a239

Browse files
committed
Use trivial write to escape traceback formatter
1 parent f0af27d commit 042a239

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎Lib/_pyrepl/simple_interact.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@ def maybe_run_command(statement: str) -> bool:
170170
console.write("\n")
171171
console._excepthook(type(exc), exc, tb=None) # type: ignore[attr-defined] # hides traceback
172172
console.resetbuffer()
173-
except MemoryError as exc:
174-
console.write("\n")
175-
console._excepthook(type(exc), exc, tb=None) # type: ignore[attr-defined] # hides traceback
173+
except MemoryError:
174+
console.write("\nMemoryError\n") # trivial write to use less memory
176175
console.resetbuffer()
177176
except SystemExit:
178177
raise

0 commit comments

Comments
 (0)