From ec52d2dae6fa2a332c0466d8d10618118807495d Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Thu, 30 Sep 2021 16:19:42 +0530 Subject: [PATCH] Added ignore comments for bare except warnings --- src/messagetypes/__init__.py | 2 +- src/mock/class_addressGenerator.py | 2 +- src/network/receivequeuethread.py | 2 +- src/plugins/indicator_libmessaging.py | 2 +- src/tests/core.py | 2 +- src/tests/test_process.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/messagetypes/__init__.py b/src/messagetypes/__init__.py index 88c37f47..86aca1f4 100644 --- a/src/messagetypes/__init__.py +++ b/src/messagetypes/__init__.py @@ -31,7 +31,7 @@ def constructObject(data): except KeyError as e: logger.error("Missing mandatory key %s", e) return None - except: + except: # noqa:E722 logger.error("classBase fail", exc_info=True) return None else: diff --git a/src/mock/class_addressGenerator.py b/src/mock/class_addressGenerator.py index 907f3810..d8ec802d 100644 --- a/src/mock/class_addressGenerator.py +++ b/src/mock/class_addressGenerator.py @@ -66,7 +66,7 @@ class FakeAddressGenerator(StoppableThread): def stopThread(self): try: queues.addressGeneratorQueue.put(("stopThread", "data")) - except: + except: # noqa:E722 pass super(FakeAddressGenerator, self).stopThread() diff --git a/src/network/receivequeuethread.py b/src/network/receivequeuethread.py index bf1d8300..56c01b77 100644 --- a/src/network/receivequeuethread.py +++ b/src/network/receivequeuethread.py @@ -51,6 +51,6 @@ class ReceiveQueueThread(StoppableThread): connection.set_state("close", 0) else: self.logger.error('Socket error: %s', err) - except: + except: # noqa:E722 self.logger.error('Error processing', exc_info=True) receiveDataQueue.task_done() diff --git a/src/plugins/indicator_libmessaging.py b/src/plugins/indicator_libmessaging.py index 60bf5e7e..b471d2ef 100644 --- a/src/plugins/indicator_libmessaging.py +++ b/src/plugins/indicator_libmessaging.py @@ -18,7 +18,7 @@ class IndicatorLibmessaging(object): self.app = MessagingMenu.App(desktop_id='pybitmessage.desktop') self.app.register() self.app.connect('activate-source', self.activate) - except: + except: # noqa:E722 self.app = None return diff --git a/src/tests/core.py b/src/tests/core.py index 18685e13..52cea234 100644 --- a/src/tests/core.py +++ b/src/tests/core.py @@ -117,7 +117,7 @@ class TestCore(unittest.TestCase): while asyncore.socket_map: print("loop, state = %s" % direct.state) asyncore.loop(timeout=10, count=1) - except: + except: # noqa:E722 self.fail('Exception in test loop') def _load_knownnodes(self, filepath): diff --git a/src/tests/test_process.py b/src/tests/test_process.py index bcec289f..0d7a02af 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: # pylint: disable=bare-except + except: # noqa:E722 thread_names = [] running_threads = len(thread_names)