From c03336dc8b47f1a8c4081bab7ed5f5e18cb602b9 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Wed, 11 Dec 2024 12:00:06 -0600 Subject: [PATCH] Directly print traceback Since the shell.showtraceback is giving some issues --- manimlib/scene/scene_embed.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manimlib/scene/scene_embed.py b/manimlib/scene/scene_embed.py index d5873c2c..7da9b5a1 100644 --- a/manimlib/scene/scene_embed.py +++ b/manimlib/scene/scene_embed.py @@ -1,5 +1,7 @@ import inspect import pyperclip +import traceback + from IPython.core.getipython import get_ipython from IPython.terminal import pt_inputhooks @@ -95,7 +97,7 @@ def ensure_flash_on_error(shell, scene): """Flash border, and potentially play sound, on exceptions""" def custom_exc(shell, etype, evalue, tb, tb_offset=None): # Show the error don't just swallow it - shell.showtraceback((etype, evalue, tb), tb_offset=tb_offset) + print(''.join(traceback.format_exception(etype, evalue, tb))) rect = FullScreenRectangle().set_stroke(RED, 30).set_fill(opacity=0) rect.fix_in_frame() scene.play(VFadeInThenOut(rect, run_time=0.5))