Updated specific exceptions instead of bare except ignore comments

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-10-01 21:43:18 +05:30
parent ec52d2dae6
commit 84c545ad8e
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
2 changed files with 3 additions and 3 deletions

View File

@ -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):

View File

@ -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)