From dd9697fef8103b93cc9ecfbc71fa83cd838f1398 Mon Sep 17 00:00:00 2001 From: Mehrdad Afshari Date: Wed, 18 Apr 2018 23:48:15 -0700 Subject: [PATCH] Eliminate broad-except suppression --- .pylintrc-tests | 1 - src/python/grpcio_tests/tests/stress/test_runner.py | 2 +- src/python/grpcio_tests/tests/unit/_cython/test_utilities.py | 2 +- src/python/grpcio_tests/tests/unit/_exit_test.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.pylintrc-tests b/.pylintrc-tests index c5202067eca..b358b2c4a0e 100644 --- a/.pylintrc-tests +++ b/.pylintrc-tests @@ -40,7 +40,6 @@ disable= too-many-locals, redefined-variable-type, redefined-outer-name, - broad-except, ungrouped-imports, too-many-branches, too-many-arguments, diff --git a/src/python/grpcio_tests/tests/stress/test_runner.py b/src/python/grpcio_tests/tests/stress/test_runner.py index d5038e3ba24..764cda17fbb 100644 --- a/src/python/grpcio_tests/tests/stress/test_runner.py +++ b/src/python/grpcio_tests/tests/stress/test_runner.py @@ -50,7 +50,7 @@ class TestRunner(threading.Thread): test_case.test_interoperability(self._stub, None) end_time = time.time() self._histogram.add((end_time - start_time) * 1e9) - except Exception as e: + except Exception as e: # pylint: disable=broad-except traceback.print_exc() self._exception_queue.put( Exception("An exception occured during test {}" diff --git a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py index ee5c7795a9b..7d5eaaaa842 100644 --- a/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py +++ b/src/python/grpcio_tests/tests/unit/_cython/test_utilities.py @@ -25,7 +25,7 @@ class SimpleFuture(object): def wrapped_function(): try: self._result = function(*args, **kwargs) - except Exception as error: + except Exception as error: # pylint: disable=broad-except self._error = error self._result = None diff --git a/src/python/grpcio_tests/tests/unit/_exit_test.py b/src/python/grpcio_tests/tests/unit/_exit_test.py index 6e6d9de0fb7..f40f3ae07cd 100644 --- a/src/python/grpcio_tests/tests/unit/_exit_test.py +++ b/src/python/grpcio_tests/tests/unit/_exit_test.py @@ -49,7 +49,7 @@ def cleanup_processes(): for process in processes: try: process.kill() - except Exception: + except Exception: # pylint: disable=broad-except pass