Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit dbec597

Browse files
authored
Update jupyter_app.py
1 parent fc3971a commit dbec597

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

jupyter_dash/jupyter_app.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import re
1010
import sys
1111
import inspect
12+
import traceback
1213
import warnings
1314

1415
from IPython import get_ipython
@@ -20,27 +21,12 @@
2021
from .comms import _dash_comm, _jupyter_config, _request_jupyter_config
2122

2223

23-
def _get_skip(error: Exception, divider=2):
24-
25-
try:
26-
# pylint: disable=import-outside-toplevel
27-
from werkzeug.debug import tbtools
28-
except ImportError:
29-
tbtools = None
30-
31-
# werkzeug<2.1.0
32-
if hasattr(tbtools, "get_current_traceback"):
33-
tb = tbtools.get_current_traceback()
34-
text = tb.plaintext.splitlines()
35-
36-
if hasattr(tbtools, "DebugTraceback"):
37-
tb = tbtools.DebugTraceback(error) # pylint: disable=no-member
38-
text = tb.render_traceback_text().splitlines()
39-
24+
def _get_skip(error: Exception):
25+
tb = traceback.format_exception(type(error), error, error.__traceback__)
4026
skip = 0
4127
for i, line in enumerate(text):
4228
if "%% callback invoked %%" in line:
43-
skip = int((i + 1) / divider)
29+
skip = i + 1
4430
break
4531
return skip
4632

0 commit comments

Comments
 (0)