diff options
author | Nathaniel Manista <nathaniel@google.com> | 2017-03-02 19:25:19 +0000 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2017-03-02 23:43:16 +0000 |
commit | 4531cbe9379140f72c37f8d784bf6833921c4900 (patch) | |
tree | caf17981e39034bbdb9df16d4c05eda29c55fa38 | |
parent | 8903a19b0d2cfd11e1170d088dd98cefb19d7a9a (diff) |
Selectively suppress and enable broad-except lint
-rw-r--r-- | .pylintrc | 3 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_auth.py | 2 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_channel.py | 2 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_plugin_wrapping.py | 4 |
4 files changed, 5 insertions, 6 deletions
@@ -26,7 +26,6 @@ notes=FIXME,XXX #TODO: Enable cyclic-import #TODO: Enable redefined-outer-name #TODO: Enable too-many-instance-attributes -#TODO: Enable broad-except #TODO: Enable too-many-locals #TODO: Enable too-many-lines #TODO: Enable redefined-variable-type @@ -37,4 +36,4 @@ notes=FIXME,XXX #TODO: Enable too-many-nested-blocks #TODO: Enable super-init-not-called -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,wrong-import-order,cyclic-import,redefined-outer-name,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 +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,wrong-import-order,cyclic-import,redefined-outer-name,too-many-instance-attributes,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 diff --git a/src/python/grpcio/grpc/_auth.py b/src/python/grpcio/grpc/_auth.py index 3e7250e85e..cb7c6fe4fd 100644 --- a/src/python/grpcio/grpc/_auth.py +++ b/src/python/grpcio/grpc/_auth.py @@ -44,7 +44,7 @@ def _create_get_token_callback(callback): def get_token_callback(future): try: access_token = future.result().access_token - except Exception as exception: + except Exception as exception: # pylint: disable=broad-except _sign_request(callback, None, exception) else: _sign_request(callback, access_token, None) diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index 36dfc0d7b2..e3686ae1b8 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -200,7 +200,7 @@ def _consume_request_iterator(request_iterator, state, call, request = next(request_iterator) except StopIteration: break - except Exception: + except Exception: # pylint: disable=broad-except logging.exception("Exception iterating requests!") call.cancel() _abort(state, grpc.StatusCode.UNKNOWN, diff --git a/src/python/grpcio/grpc/_plugin_wrapping.py b/src/python/grpcio/grpc/_plugin_wrapping.py index 69c46aa546..46e4e1d869 100644 --- a/src/python/grpcio/grpc/_plugin_wrapping.py +++ b/src/python/grpcio/grpc/_plugin_wrapping.py @@ -67,8 +67,8 @@ class _WrappedCygrpcCallback(object): def _invoke_success(self, metadata): try: cygrpc_metadata = _common.cygrpc_metadata(metadata) - except Exception as error: - self._invoke_failure(error) + except Exception as exception: # pylint: disable=broad-except + self._invoke_failure(exception) return self.cygrpc_callback(cygrpc_metadata, cygrpc.StatusCode.ok, b'') |