mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Directly print traceback
Since the shell.showtraceback is giving some issues
This commit is contained in:
parent
3abe3e8189
commit
c03336dc8b
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
||||||
import inspect
|
import inspect
|
||||||
import pyperclip
|
import pyperclip
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
from IPython.core.getipython import get_ipython
|
from IPython.core.getipython import get_ipython
|
||||||
from IPython.terminal import pt_inputhooks
|
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"""
|
"""Flash border, and potentially play sound, on exceptions"""
|
||||||
def custom_exc(shell, etype, evalue, tb, tb_offset=None):
|
def custom_exc(shell, etype, evalue, tb, tb_offset=None):
|
||||||
# Show the error don't just swallow it
|
# 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 = FullScreenRectangle().set_stroke(RED, 30).set_fill(opacity=0)
|
||||||
rect.fix_in_frame()
|
rect.fix_in_frame()
|
||||||
scene.play(VFadeInThenOut(rect, run_time=0.5))
|
scene.play(VFadeInThenOut(rect, run_time=0.5))
|
||||||
|
|
Loading…
Add table
Reference in a new issue