Skip to content

Commit

Permalink
Add a test to show problem/fix for exceptions without a traceback.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjurka committed Oct 3, 2021
1 parent b397c96 commit 39ec82a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_debug.py
Expand Up @@ -6,6 +6,7 @@

from werkzeug.debug import console
from werkzeug.debug import DebuggedApplication
from werkzeug.debug import get_current_traceback
from werkzeug.debug import get_machine_id
from werkzeug.debug.console import HTMLStringO
from werkzeug.debug.repr import debug_repr
Expand Down Expand Up @@ -350,3 +351,12 @@ class MutableException(ValueError):
except MutableException:
# previously crashed: `TypeError: unhashable type 'MutableException'`
Traceback(*sys.exc_info())


def test_linked_exception_wo_traceback():
try:
raise Exception("msg1")
except Exception as e:
e.__context__ = Exception("msg2")
# previously crashed: `IndexError: list index out of range`
get_current_traceback()

0 comments on commit 39ec82a

Please sign in to comment.