Further pleasing the pylint gods

This commit is contained in:
Miroslav Stampar
2019-05-30 22:40:51 +02:00
parent 1f7ee039ad
commit f8e9f9c87d
14 changed files with 38 additions and 50 deletions

View File

@@ -11,7 +11,7 @@ from lib.core.data import logger
from lib.core.enums import CUSTOM_LOGGING
from lib.core.enums import TIMEOUT_STATE
def timeout(func, args=(), kwargs={}, duration=1, default=None):
def timeout(func, args=None, kwargs=None, duration=1, default=None):
class InterruptableThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
@@ -20,7 +20,7 @@ def timeout(func, args=(), kwargs={}, duration=1, default=None):
def run(self):
try:
self.result = func(*args, **kwargs)
self.result = func(*(args or ()), **(kwargs or {}))
self.timeout_state = TIMEOUT_STATE.NORMAL
except Exception as ex:
logger.log(CUSTOM_LOGGING.TRAFFIC_IN, ex)