Fix and enable dangerous-default-value lint

The fix is more of an elision and the code in the changed area is
reflowed.
pull/9735/head
Nathaniel Manista 8 years ago
parent 3577f63136
commit 402aca6621
  1. 3
      .pylintrc
  2. 21
      src/python/grpcio/grpc/_common.py

@ -32,6 +32,5 @@
#TODO: Enable simplifiable-if-statement
#TODO: Enable no-self-use
#TODO: Enable no-member
#TODO: Enable dangerous-default-value
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,fixme,wrong-import-order,no-value-for-parameter,cyclic-import,unused-variable,redefined-outer-name,unused-import,too-many-instance-attributes,broad-except,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called,simplifiable-if-statement,no-self-use,no-member,dangerous-default-value
disable=missing-docstring,too-few-public-methods,too-many-arguments,no-init,duplicate-code,invalid-name,suppressed-message,locally-disabled,protected-access,no-name-in-module,unused-argument,fixme,wrong-import-order,no-value-for-parameter,cyclic-import,unused-variable,redefined-outer-name,unused-import,too-many-instance-attributes,broad-except,too-many-locals,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-return-statements,too-many-nested-blocks,super-init-not-called,simplifiable-if-statement,no-self-use,no-member

@ -153,13 +153,7 @@ class CleanupThread(threading.Thread):
we accomplish this by overriding the join() method.
"""
def __init__(self,
behavior,
group=None,
target=None,
name=None,
args=(),
kwargs={}):
def __init__(self, behavior, *args, **kwargs):
"""Constructor.
Args:
@ -167,17 +161,10 @@ class CleanupThread(threading.Thread):
argument, timeout, indicating the maximum duration of
`behavior`, or None indicating `behavior` has no deadline.
`behavior` must be idempotent.
group (None): should be None. Reseved for future extensions
when ThreadGroup is implemented.
target (function): The function to invoke when this thread is
run. Defaults to None.
name (str): The name of this thread. Defaults to None.
args (tuple[object]): A tuple of arguments to pass to `target`.
kwargs (dict[str,object]): A dictionary of keyword arguments to
pass to `target`.
args: Positional arguments passed to threading.Thread constructor.
kwargs: Keyword arguments passed to threading.Thread constructor.
"""
super(CleanupThread, self).__init__(
group=group, target=target, name=name, args=args, kwargs=kwargs)
super(CleanupThread, self).__init__(*args, **kwargs)
self._behavior = behavior
def join(self, timeout=None):

Loading…
Cancel
Save