Skip to content

Commit 7590a9a

Browse files
committed
.
1 parent 3ebeee8 commit 7590a9a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sentry_sdk/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
# These exceptions won't set the span status to error if they occur. Use
9292
# register_control_flow_exception to add to this list
93-
_control_flow_exceptions = []
93+
_control_flow_exception_classes: "list[type]" = []
9494

9595

9696
def is_internal_task() -> bool:
@@ -1983,15 +1983,15 @@ def get_current_thread_meta(
19831983

19841984

19851985
def register_control_flow_exception(exc_type: type) -> None:
1986-
_control_flow_exceptions.append(exc_type)
1986+
_control_flow_exception_classes.append(exc_type)
19871987

19881988

19891989
def should_be_treated_as_error(ty: "Any", value: "Any") -> bool:
19901990
if ty == SystemExit and hasattr(value, "code") and value.code in (0, None):
19911991
# https://docs.python.org/3/library/exceptions.html#SystemExit
19921992
return False
19931993

1994-
if ty in _control_flow_exceptions:
1994+
if issubclass(ty, tuple(_control_flow_exception_classes)):
19951995
return False
19961996

19971997
return True

0 commit comments

Comments
 (0)