Skip to content

Commit dd3ed34

Browse files
committed
Use issubclass for exception filter to allow matching by baseclass etc
1 parent f062399 commit dd3ed34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stackprinter/formatting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ def format_exc_info(etype, evalue, tb, style='plaintext', add_summary='auto',
157157
parts = []
158158
if tb:
159159
frameinfos = [ex.get_info(tb_) for tb_ in _walk_traceback(tb)]
160-
if suppressed_exceptions and etype in suppressed_exceptions:
160+
if (suppressed_exceptions and
161+
issubclass(etype, tuple(suppressed_exceptions))):
161162
summary = format_summary(frameinfos, style=style,
162163
reverse=reverse, **kwargs)
163164
parts = [summary]

0 commit comments

Comments
 (0)