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: for char in string:
num *= base num *= base
num += alphabet.index(char) num += alphabet.index(char)
except: # ValueError except: # noqa:E722 # ValueError
# character not found (like a space character or a 0) # character not found (like a space character or a 0)
return 0 return 0
return num return num

View File

@ -130,7 +130,7 @@ def set_background_title(d, title):
"""Setting background title""" """Setting background title"""
try: try:
d.set_background_title(title) d.set_background_title(title)
except: except: # noqa:E722
d.add_persistent_args(("--backtitle", title)) d.add_persistent_args(("--backtitle", title))
@ -138,7 +138,7 @@ def scrollbox(d, text, height=None, width=None):
"""Setting scroll box""" """Setting scroll box"""
try: try:
d.scrollbox(text, height, width, exit_label="Continue") d.scrollbox(text, height, width, exit_label="Continue")
except: except: # noqa:E722
d.msgbox(text, height or 0, width or 0, ok_label="Continue") d.msgbox(text, height or 0, width or 0, ok_label="Continue")
@ -1003,7 +1003,7 @@ def loadInbox():
tolabel = BROADCAST_STR tolabel = BROADCAST_STR
else: else:
tolabel = BMConfigParser().get(toaddr, "label") tolabel = BMConfigParser().get(toaddr, "label")
except: except: # noqa:E722
tolabel = "" tolabel = ""
if tolabel == "": if tolabel == "":
tolabel = toaddr tolabel = toaddr

View File

@ -25,7 +25,7 @@ class smtpDeliver(StoppableThread):
# pylint: disable=no-member # pylint: disable=no-member
try: try:
queues.UISignallerQueue.put(("stopThread", "data")) queues.UISignallerQueue.put(("stopThread", "data"))
except: except: # noqa:E722
pass pass
super(smtpDeliver, self).stopThread() super(smtpDeliver, self).stopThread()
@ -78,7 +78,7 @@ class smtpDeliver(StoppableThread):
'Delivered via SMTP to %s through %s:%i ...', 'Delivered via SMTP to %s through %s:%i ...',
to, u.hostname, u.port) to, u.hostname, u.port)
client.quit() client.quit()
except: except: # noqa:E722
self.logger.error('smtp delivery error', exc_info=True) self.logger.error('smtp delivery error', exc_info=True)
elif command == 'displayNewSentMessage': elif command == 'displayNewSentMessage':
toAddress, fromLabel, fromAddress, subject, message, ackdata = data toAddress, fromLabel, fromAddress, subject, message, ackdata = data

View File

@ -265,7 +265,7 @@ def check_openssl():
path = ctypes.util.find_library('ssl') path = ctypes.util.find_library('ssl')
if path not in paths: if path not in paths:
paths.append(path) paths.append(path)
except: except: # noqa:E722
pass pass
openssl_version = None openssl_version = None
@ -432,7 +432,7 @@ def check_dependencies(verbose=False, optional=False):
for check in check_functions: for check in check_functions:
try: try:
has_all_dependencies &= check() has_all_dependencies &= check()
except: except: # noqa:E722
logger.exception('%s failed unexpectedly.', check.__name__) logger.exception('%s failed unexpectedly.', check.__name__)
has_all_dependencies = False has_all_dependencies = False

View File

@ -134,7 +134,7 @@ class MsgDecode(object):
raise MsgDecodeException("Malformed message") raise MsgDecodeException("Malformed message")
try: try:
msgObj.process() msgObj.process()
except: except: # noqa:E722
raise MsgDecodeException("Malformed message") raise MsgDecodeException("Malformed message")
if msgType == "message": if msgType == "message":
self.subject = msgObj.subject self.subject = msgObj.subject

View File

@ -55,7 +55,7 @@ def loadConfig():
logger.info('Loading config files from same directory as program.') logger.info('Loading config files from same directory as program.')
needToCreateKeysFile = False needToCreateKeysFile = False
state.appdata = paths.lookupExeFolder() state.appdata = paths.lookupExeFolder()
except: except: # noqa:E722
# Could not load the keys.dat file in the program directory. # Could not load the keys.dat file in the program directory.
# Perhaps it is in the appdata directory. # Perhaps it is in the appdata directory.
state.appdata = paths.lookupAppdataFolder() state.appdata = paths.lookupAppdataFolder()

View File

@ -95,7 +95,7 @@ def verify(msg, sig, hexPubkey):
# old SHA1 algorithm. # old SHA1 algorithm.
sigVerifyPassed = makePubCryptor(hexPubkey).verify( sigVerifyPassed = makePubCryptor(hexPubkey).verify(
sig, msg, digest_alg=OpenSSL.digest_ecdsa_sha1) sig, msg, digest_alg=OpenSSL.digest_ecdsa_sha1)
except: except: # noqa:E722
sigVerifyPassed = False sigVerifyPassed = False
if sigVerifyPassed: if sigVerifyPassed:
# The signature check passed using SHA1 # The signature check passed using SHA1
@ -104,7 +104,7 @@ def verify(msg, sig, hexPubkey):
try: try:
return makePubCryptor(hexPubkey).verify( return makePubCryptor(hexPubkey).verify(
sig, msg, digest_alg=OpenSSL.EVP_sha256) sig, msg, digest_alg=OpenSSL.EVP_sha256)
except: except: # noqa:E722
return False return False