File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
9696def is_internal_task () -> bool :
@@ -1983,15 +1983,15 @@ def get_current_thread_meta(
19831983
19841984
19851985def 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
19891989def 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
You can’t perform that action at this time.
0 commit comments