From 3ec1366eb6cc9d6f7a00b0de8c73a5c657daf21d Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 3 Mar 2017 06:23:53 +0000 Subject: [PATCH] Enable unused-argument lint --- .pylintrc | 3 +-- src/python/grpcio/grpc/_channel.py | 10 +++------- src/python/grpcio/grpc/beta/_client_adaptations.py | 2 +- src/python/grpcio/grpc/beta/_server_adaptations.py | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.pylintrc b/.pylintrc index dbfdc737316..41027479061 100644 --- a/.pylintrc +++ b/.pylintrc @@ -25,7 +25,6 @@ notes=FIXME,XXX #TODO: Enable locally-disabled #TODO: Enable protected-access #TODO: Enable no-name-in-module -#TODO: Enable unused-argument #TODO: Enable wrong-import-order # TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279): # enable cyclic-import after a 1.7-or-later pylint release that recognizes our @@ -38,4 +37,4 @@ notes=FIXME,XXX #TODO: Enable useless-else-on-loop #TODO: Enable too-many-nested-blocks -disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,unused-argument,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks +disable=missing-docstring,too-few-public-methods,no-init,duplicate-code,invalid-name,locally-disabled,protected-access,no-name-in-module,wrong-import-order,cyclic-import,too-many-instance-attributes,too-many-lines,redefined-variable-type,next-method-called,import-error,useless-else-on-loop,too-many-nested-blocks diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index b4145fee91a..4329c9934ce 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -237,7 +237,7 @@ def _consume_request_iterator(request_iterator, state, call, cygrpc.Operations(operations), event_handler) state.due.add(cygrpc.OperationType.send_close_from_client) - def stop_consumption_thread(timeout): + def stop_consumption_thread(timeout): # pylint: disable=unused-argument with state.condition: if state.code is None: call.cancel() @@ -736,7 +736,7 @@ def _run_channel_spin_thread(state): state.managed_calls = None return - def stop_channel_spin(timeout): + def stop_channel_spin(timeout): # pylint: disable=unused-argument with state.lock: if state.managed_calls is not None: for call in state.managed_calls: @@ -877,12 +877,8 @@ def _moot(state): def _subscribe(state, callback, try_to_connect): with state.lock: if not state.callbacks_and_connectivities and not state.polling: - - def cancel_all_subscriptions(timeout): - _moot(state) - polling_thread = _common.CleanupThread( - cancel_all_subscriptions, + lambda timeout: _moot(state), target=_poll_connectivity, args=(state, state.channel, bool(try_to_connect))) polling_thread.start() diff --git a/src/python/grpcio/grpc/beta/_client_adaptations.py b/src/python/grpcio/grpc/beta/_client_adaptations.py index 9b5f5766d25..3c69acc0195 100644 --- a/src/python/grpcio/grpc/beta/_client_adaptations.py +++ b/src/python/grpcio/grpc/beta/_client_adaptations.py @@ -35,7 +35,7 @@ from grpc.framework.common import cardinality from grpc.framework.foundation import future from grpc.framework.interfaces.face import face -# pylint: disable=too-many-arguments,too-many-locals +# pylint: disable=too-many-arguments,too-many-locals,unused-argument _STATUS_CODE_TO_ABORTION_KIND_AND_ABORTION_ERROR_CLASS = { grpc.StatusCode.CANCELLED: (face.Abortion.Kind.CANCELLED, diff --git a/src/python/grpcio/grpc/beta/_server_adaptations.py b/src/python/grpcio/grpc/beta/_server_adaptations.py index ed6aa4c3efb..cf10c26d2fe 100644 --- a/src/python/grpcio/grpc/beta/_server_adaptations.py +++ b/src/python/grpcio/grpc/beta/_server_adaptations.py @@ -181,7 +181,7 @@ def _run_request_pipe_thread(request_iterator, request_consumer, return request_consumer.terminate() - def stop_request_pipe(timeout): + def stop_request_pipe(timeout): # pylint: disable=unused-argument thread_joined.set() request_pipe_thread = _common.CleanupThread(