Cleanup, try to get rid of linter messages.
authorScott Gasch <[email protected]>
Sat, 2 Apr 2022 17:56:53 +0000 (10:56 -0700)
committerScott Gasch <[email protected]>
Sat, 2 Apr 2022 17:56:53 +0000 (10:56 -0700)
decorator_utils.py

index 084e260bab370d9bbb93a1256ff84e98f96055bd..80aec4aaae788023f04588d4a78327a761cf1638 100644 (file)
@@ -18,7 +18,7 @@ import threading
 import time
 import traceback
 import warnings
-from typing import Any, Callable, Optional
+from typing import Any, Callable, List, Optional
 
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
@@ -510,7 +510,7 @@ def thunkify(func):
         wait_event = threading.Event()
 
         result = [None]
-        exc = [False, None]
+        exc: List[Any] = [False, None]
 
         def worker_func():
             try:
@@ -527,6 +527,7 @@ def thunkify(func):
         def thunk():
             wait_event.wait()
             if exc[0]:
+                assert exc[1]
                 raise exc[1][0](exc[1][1])
             return result[0]
 
@@ -673,7 +674,7 @@ def timeout(
     def decorate(function):
         if use_signals:
 
-            def handler(signum, frame):
+            def handler(unused_signum, unused_frame):
                 _raise_exception(timeout_exception, error_message)
 
             @functools.wraps(function)