From a704b1a3b2646eb1c8678dca8f185ca9cf64926f Mon Sep 17 00:00:00 2001 From: "kuldeep.k@cisinlabs.com" Date: Thu, 16 Sep 2021 19:01:33 +0530 Subject: [PATCH] Added ignore comments for bare except warnings for addresses, class_smtpDeliver, depends, helper_msgcoding, helper_startup, highlevelcrypto, protocol & bitmessagecurses/__init__ files --- src/addresses.py | 2 +- src/bitmessagecurses/__init__.py | 6 +++--- src/class_smtpDeliver.py | 4 ++-- src/depends.py | 4 ++-- src/helper_msgcoding.py | 2 +- src/helper_startup.py | 2 +- src/highlevelcrypto.py | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/addresses.py b/src/addresses.py index 79d4c075..dd3580f6 100644 --- a/src/addresses.py +++ b/src/addresses.py @@ -45,7 +45,7 @@ def decodeBase58(string, alphabet=ALPHABET): for char in string: num *= base num += alphabet.index(char) - except: # ValueError + except: # noqa:E722 # ValueError # character not found (like a space character or a 0) return 0 return num diff --git a/src/bitmessagecurses/__init__.py b/src/bitmessagecurses/__init__.py index 14ba6651..7b52457d 100644 --- a/src/bitmessagecurses/__init__.py +++ b/src/bitmessagecurses/__init__.py @@ -130,7 +130,7 @@ def set_background_title(d, title): """Setting background title""" try: d.set_background_title(title) - except: + except: # noqa:E722 d.add_persistent_args(("--backtitle", title)) @@ -138,7 +138,7 @@ def scrollbox(d, text, height=None, width=None): """Setting scroll box""" try: d.scrollbox(text, height, width, exit_label="Continue") - except: + except: # noqa:E722 d.msgbox(text, height or 0, width or 0, ok_label="Continue") @@ -1003,7 +1003,7 @@ def loadInbox(): tolabel = BROADCAST_STR else: tolabel = BMConfigParser().get(toaddr, "label") - except: + except: # noqa:E722 tolabel = "" if tolabel == "": tolabel = toaddr diff --git a/src/class_smtpDeliver.py b/src/class_smtpDeliver.py index 4f8422cc..08cb35ab 100644 --- a/src/class_smtpDeliver.py +++ b/src/class_smtpDeliver.py @@ -25,7 +25,7 @@ class smtpDeliver(StoppableThread): # pylint: disable=no-member try: queues.UISignallerQueue.put(("stopThread", "data")) - except: + except: # noqa:E722 pass super(smtpDeliver, self).stopThread() @@ -78,7 +78,7 @@ class smtpDeliver(StoppableThread): 'Delivered via SMTP to %s through %s:%i ...', to, u.hostname, u.port) client.quit() - except: + except: # noqa:E722 self.logger.error('smtp delivery error', exc_info=True) elif command == 'displayNewSentMessage': toAddress, fromLabel, fromAddress, subject, message, ackdata = data diff --git a/src/depends.py b/src/depends.py index ae1f6f27..bce4e695 100755 --- a/src/depends.py +++ b/src/depends.py @@ -265,7 +265,7 @@ def check_openssl(): path = ctypes.util.find_library('ssl') if path not in paths: paths.append(path) - except: + except: # noqa:E722 pass openssl_version = None @@ -432,7 +432,7 @@ def check_dependencies(verbose=False, optional=False): for check in check_functions: try: has_all_dependencies &= check() - except: + except: # noqa:E722 logger.exception('%s failed unexpectedly.', check.__name__) has_all_dependencies = False diff --git a/src/helper_msgcoding.py b/src/helper_msgcoding.py index 8c1cfafe..28f92288 100644 --- a/src/helper_msgcoding.py +++ b/src/helper_msgcoding.py @@ -134,7 +134,7 @@ class MsgDecode(object): raise MsgDecodeException("Malformed message") try: msgObj.process() - except: + except: # noqa:E722 raise MsgDecodeException("Malformed message") if msgType == "message": self.subject = msgObj.subject diff --git a/src/helper_startup.py b/src/helper_startup.py index c0c35fd9..5c865f49 100644 --- a/src/helper_startup.py +++ b/src/helper_startup.py @@ -55,7 +55,7 @@ def loadConfig(): logger.info('Loading config files from same directory as program.') needToCreateKeysFile = False state.appdata = paths.lookupExeFolder() - except: + except: # noqa:E722 # Could not load the keys.dat file in the program directory. # Perhaps it is in the appdata directory. state.appdata = paths.lookupAppdataFolder() diff --git a/src/highlevelcrypto.py b/src/highlevelcrypto.py index 82743acf..431a6dae 100644 --- a/src/highlevelcrypto.py +++ b/src/highlevelcrypto.py @@ -95,7 +95,7 @@ def verify(msg, sig, hexPubkey): # old SHA1 algorithm. sigVerifyPassed = makePubCryptor(hexPubkey).verify( sig, msg, digest_alg=OpenSSL.digest_ecdsa_sha1) - except: + except: # noqa:E722 sigVerifyPassed = False if sigVerifyPassed: # The signature check passed using SHA1 @@ -104,7 +104,7 @@ def verify(msg, sig, hexPubkey): try: return makePubCryptor(hexPubkey).verify( sig, msg, digest_alg=OpenSSL.EVP_sha256) - except: + except: # noqa:E722 return False