From 84c545ad8ef36b55916345381b246652c3e720f8 Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Fri, 1 Oct 2021 21:43:18 +0530 Subject: [PATCH] Updated specific exceptions instead of bare except ignore comments --- src/mock/class_addressGenerator.py | 4 ++-- src/tests/test_process.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mock/class_addressGenerator.py b/src/mock/class_addressGenerator.py index d8ec802d..700da33f 100644 --- a/src/mock/class_addressGenerator.py +++ b/src/mock/class_addressGenerator.py @@ -66,8 +66,8 @@ class FakeAddressGenerator(StoppableThread): def stopThread(self): try: queues.addressGeneratorQueue.put(("stopThread", "data")) - except: # noqa:E722 - pass + except queue.Full: + self.logger.error('addressGeneratorQueue is Full') super(FakeAddressGenerator, self).stopThread() def run(self): diff --git a/src/tests/test_process.py b/src/tests/test_process.py index 0d7a02af..5cc9e07b 100644 --- a/src/tests/test_process.py +++ b/src/tests/test_process.py @@ -147,7 +147,7 @@ class TestProcessProto(unittest.TestCase): "ps", "-L", "-o", "comm=", "--pid", str(self.process.pid) ]).split() - except: # noqa:E722 + except subprocess.CalledProcessError: thread_names = [] running_threads = len(thread_names)