Index: build/android/pylib/utils/timeout_retry.py |
diff --git a/build/android/pylib/utils/timeout_retry.py b/build/android/pylib/utils/timeout_retry.py |
index bc7e891d0b15dd82088911b500d4f788ee7080cf..cdd8b9a593bf5943f748b259b44b4dd3ba267806 100644 |
--- a/build/android/pylib/utils/timeout_retry.py |
+++ b/build/android/pylib/utils/timeout_retry.py |
@@ -3,15 +3,15 @@ |
# found in the LICENSE file. |
"""A utility to run functions with timeouts and retries.""" |
-# pylint: disable=W0702 |
+import functools |
import threading |
-from pylib.utils import reraiser_thread |
-from pylib.utils import watchdog_timer |
+import reraiser_thread |
+import watchdog_timer |
-def Run(func, timeout, retries, args=None, kwargs=None): |
+def Run(func, timeout, retries, args=[], kwargs={}): |
"""Runs the passed function in a separate thread with timeouts and retries. |
Args: |
@@ -24,11 +24,6 @@ def Run(func, timeout, retries, args=None, kwargs=None): |
Returns: |
The return value of func(*args, **kwargs). |
""" |
- if not args: |
- args = [] |
- if not kwargs: |
- kwargs = {} |
- |
# The return value uses a list because Python variables are references, not |
# values. Closures make a copy of the reference, so updating the closure's |
# reference wouldn't update where the original reference pointed. |