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

@@ -57,10 +57,10 @@ class _GetchMacCarbon(object):
"""
def __init__(self):
import Carbon
Carbon.Evt # see if it has this (in Unix, it doesn't)
_ = Carbon.Evt # see if it has this (in Unix, it doesn't)
def __call__(self):
import Carbon
if Carbon.Evt.EventAvail(0x0008)[0] == 0: # 0x0008 is the keyDownMask
return ''
else:

View File

@@ -635,7 +635,7 @@ def attackDumpedTable():
col_passwords = set()
attack_dict = {}
for column in sorted(columns, key=lambda _: len(_), reverse=True):
for column in sorted(columns, key=len, reverse=True):
if column and column.lower() in COMMON_USER_COLUMNS:
col_user = column
break

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)

View File

@@ -66,9 +66,6 @@ class xrange(object):
def __hash__(self):
return hash(self._slice)
def __cmp__(self, other):
return (cmp(type(self), type(other)) or cmp(self._slice, other._slice))
def __repr__(self):
return '%s(%r, %r, %r)' % (type(self).__name__, self.start, self.stop, self.step)