Added ignore comments for bare except warnings for addresses, class_smtpDeliver, depends, helper_msgcoding, helper_startup, highlevelcrypto, protocol & bitmessagecurses/__init__ files

This commit is contained in:
kuldeep.k@cisinlabs.com 2021-09-16 19:01:33 +05:30
parent e8b80f6117
commit a704b1a3b2
No known key found for this signature in database
GPG Key ID: AF4FB299BF7C7C2A
7 changed files with 12 additions and 12 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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