Code Quality #2178
|
@ -78,7 +78,7 @@ class InvThread(StoppableThread):
|
|||
if connection == Dandelion().objectChildStem(inv[1]):
|
||||
# Fluff trigger by RNG
|
||||
# auto-ignore if config set to 0, i.e. dandelion is off
|
||||
if random.randint(1, 100) >= state.dandelion:
|
||||
if random.randint(1, 100) >= state.dandelion: # nosec:B311
|
||||
fluffs.append(inv[1])
|
||||
# send a dinv only if the stem node supports dandelion
|
||||
elif connection.services & protocol.NODE_DANDELION > 0:
|
||||
|
|
|
@ -25,17 +25,17 @@ class BMNetworkThread(StoppableThread):
|
|||
for i in BMConnectionPool().listeningSockets.values():
|
||||
try:
|
||||
i.close()
|
||||
except:
|
||||
except: # nosec:B110 pylint:disable=bare-except
|
||||
pass
|
||||
for i in BMConnectionPool().outboundConnections.values():
|
||||
try:
|
||||
i.close()
|
||||
except:
|
||||
except: # nosec:B110 pylint:disable=bare-except
|
||||
pass
|
||||
for i in BMConnectionPool().inboundConnections.values():
|
||||
try:
|
||||
i.close()
|
||||
except:
|
||||
except: # nosec:B110 pylint:disable=bare-except
|
||||
pass
|
||||
|
||||
# just in case
|
||||
|
|
|
@ -47,7 +47,7 @@ def initCL():
|
|||
device_type=cl.device_type.GPU))
|
||||
if platform.vendor not in vendors:
|
||||
vendors.append(platform.vendor)
|
||||
except: # noqa:E722
|
||||
except: # nosec:B110 noqa:E722 pylint:disable=bare-except
|
||||
pass
|
||||
if enabledGpus:
|
||||
ctx = cl.Context(devices=enabledGpus)
|
||||
|
|
|
@ -82,7 +82,7 @@ def _set_idle():
|
|||
pid = win32api.GetCurrentProcessId()
|
||||
handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
|
||||
win32process.SetPriorityClass(handle, win32process.IDLE_PRIORITY_CLASS)
|
||||
except: # noqa:E722
|
||||
except: # nosec:B110 noqa:E722 pylint:disable=bare-except
|
||||
# Windows 64-bit
|
||||
pass
|
||||
|
||||
|
@ -296,14 +296,14 @@ def run(target, initialHash):
|
|||
return _doGPUPoW(target, initialHash)
|
||||
except StopIteration:
|
||||
raise
|
||||
except: # noqa:E722
|
||||
except: # nosec:B110 noqa:E722 pylint:disable=bare-except
|
||||
pass # fallback
|
||||
if bmpow:
|
||||
try:
|
||||
return _doCPoW(target, initialHash)
|
||||
except StopIteration:
|
||||
raise
|
||||
except: # noqa:E722
|
||||
except: # nosec:B110 noqa:E722 pylint:disable=bare-except
|
||||
pass # fallback
|
||||
if paths.frozen == "macosx_app" or not paths.frozen:
|
||||
# on my (Peter Surda) Windows 10, Windows Defender
|
||||
|
@ -315,13 +315,13 @@ def run(target, initialHash):
|
|||
except StopIteration:
|
||||
logger.error("Fast PoW got StopIteration")
|
||||
raise
|
||||
except: # noqa:E722
|
||||
except: # noqa:E722 pylint:disable=bare-except
|
||||
logger.error("Fast PoW got exception:", exc_info=True)
|
||||
try:
|
||||
return _doSafePoW(target, initialHash)
|
||||
except StopIteration:
|
||||
raise
|
||||
except: # noqa:E722
|
||||
except: # nosec:B110 noqa:E722 pylint:disable=bare-except
|
||||
pass # fallback
|
||||
|
||||
|
||||
|
|
|
@ -819,7 +819,7 @@ def loadOpenSSL():
|
|||
try:
|
||||
OpenSSL = _OpenSSL(library)
|
||||
return
|
||||
except Exception:
|
||||
except Exception: # nosec:B110
|
||||
pass
|
||||
raise Exception(
|
||||
"Couldn't find and load the OpenSSL library. You must install it.")
|
||||
|
|
Reference in New Issue
Block a user