Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1818)

Unified Diff: build/android/pylib/utils/reraiser_thread.py

Issue 153743008: Revert of Enable presubmit pylint in build/android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging with changes to pylib/linker/test_case.py. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/utils/report_results.py ('k') | build/android/pylib/utils/reraiser_thread_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/utils/reraiser_thread.py
diff --git a/build/android/pylib/utils/reraiser_thread.py b/build/android/pylib/utils/reraiser_thread.py
index eed72c173ead636d8397a174ef3a92757f43e596..d4ba781a32d856def495f44499ce123cd94d9fc0 100644
--- a/build/android/pylib/utils/reraiser_thread.py
+++ b/build/android/pylib/utils/reraiser_thread.py
@@ -3,14 +3,14 @@
# found in the LICENSE file.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
-# pylint: disable=W0212
import logging
import sys
import threading
+import time
import traceback
-from pylib.utils import watchdog_timer
+import watchdog_timer
class TimeoutError(Exception):
@@ -38,7 +38,7 @@ def LogThreadStack(thread):
class ReraiserThread(threading.Thread):
"""Thread class that can reraise exceptions."""
- def __init__(self, func, args=None, kwargs=None, name=None):
+ def __init__(self, func, args=[], kwargs={}, name=None):
"""Initialize thread.
Args:
@@ -48,10 +48,6 @@ class ReraiserThread(threading.Thread):
name: thread name, defaults to Thread-N.
"""
super(ReraiserThread, self).__init__(name=name)
- if not args:
- args = []
- if not kwargs:
- kwargs = {}
self.daemon = True
self._func = func
self._args = args
@@ -76,14 +72,12 @@ class ReraiserThread(threading.Thread):
class ReraiserThreadGroup(object):
"""A group of ReraiserThread objects."""
- def __init__(self, threads=None):
+ def __init__(self, threads=[]):
"""Initialize thread group.
Args:
threads: a list of ReraiserThread objects; defaults to empty.
"""
- if not threads:
- threads = []
self._threads = threads
def Add(self, thread):
« no previous file with comments | « build/android/pylib/utils/report_results.py ('k') | build/android/pylib/utils/reraiser_thread_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698