|
def should_hide_frame(frame): |
|
# type: (Any) -> bool |
|
try: |
|
mod = frame.f_globals["__name__"] |
|
return mod.startswith("sentry_sdk.") |
|
except (AttributeError, KeyError): |
|
pass |
|
|
|
for flag_name in "__traceback_hide__", "__tracebackhide__": |
|
try: |
|
if frame.f_locals[flag_name]: |
|
return True |
|
except Exception: |
|
pass |
|
|
|
return False |
If __name__ is in frame.f_globals and is a string, then no check for __hide_traceback__ is ever performed, which effectively makes that variable unusable to hide a frame from a stacktrace.
sentry-python/sentry_sdk/utils.py
Lines 211 to 226 in 8b3de2c
If
__name__is inframe.f_globalsand is a string, then no check for__hide_traceback__is ever performed, which effectively makes that variable unusable to hide a frame from a stacktrace.