Skip to content

Commit 2044be6

Browse files
style: add type annotations to unpacked tuple variables
Added explicit type annotations for err and tb variables when unpacking error_info tuples in _acquire() and _release() methods.
1 parent 05baa65 commit 2044be6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ddtrace/profiling/collector/_lock.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ def _acquire(self, inner_func: Callable[..., Any], *args: Any, **kwargs: Any) ->
187187
# Instrumentation must never crash user code
188188
pass # nosec
189189
if error_info is not None:
190+
err: BaseException
191+
tb: Optional[TracebackType]
190192
err, tb = error_info
191193
raise err.with_traceback(tb)
192194

@@ -222,6 +224,8 @@ def _release(self, inner_func: Callable[..., Any], *args: Any, **kwargs: Any) ->
222224
# Instrumentation must never crash user code
223225
pass # nosec
224226
if error_info is not None:
227+
err: BaseException
228+
tb: Optional[TracebackType]
225229
err, tb = error_info
226230
raise err.with_traceback(tb)
227231

0 commit comments

Comments
 (0)