Skip to content

Commit 57816b7

Browse files
committed
feat: Ignore __tracebackhide__ as well
py.test supports __tracebackhide__
1 parent a42dd6e commit 57816b7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

sentry_sdk/utils.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,13 @@ def iter_stacks(tb):
146146
while tb is not None:
147147
f_locals = getattr(tb, "f_locals", None)
148148
skip = False
149-
try:
150-
if f_locals["__traceback_hide__"]:
151-
skip = True
152-
except Exception:
153-
pass
149+
for flag_name in "__traceback_hide__", "__tracebackhide__":
150+
try:
151+
if f_locals[flag_name]:
152+
skip = True
153+
except Exception:
154+
pass
155+
154156
if not skip:
155157
yield tb
156158
tb = tb.tb_next

0 commit comments

Comments
 (0)