Merge pull request #2538 from ReverseControl/deepsource-fix-9833b18c

Deepsource Fix: Comprehension not required. Allow evaluation short-circuiting.
This commit is contained in:
Ross Nicoll 2021-09-06 23:59:39 +01:00 committed by GitHub
commit 152e7b3633
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -614,7 +614,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
if best_hash.count(best_hash[0]) == len(rpc_connections):
return
# Check that each peer has at least one connection
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
assert (all(len(x.getpeerinfo()) for x in rpc_connections))
time.sleep(wait)
raise AssertionError("Block sync timed out after {}s:{}".format(
timeout,
@ -637,7 +637,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
r.syncwithvalidationinterfacequeue()
return
# Check that each peer has at least one connection
assert (all([len(x.getpeerinfo()) for x in rpc_connections]))
assert (all(len(x.getpeerinfo()) for x in rpc_connections))
time.sleep(wait)
raise AssertionError("Mempool sync timed out after {}s:{}".format(
timeout,

View file

@ -535,7 +535,7 @@ def find_vout_for_address(node, txid, addr):
"""
tx = node.getrawtransaction(txid, True)
for i in range(len(tx["vout"])):
if any([addr == a for a in tx["vout"][i]["scriptPubKey"]["addresses"]]):
if any(addr == a for a in tx["vout"][i]["scriptPubKey"]["addresses"]):
return i
raise RuntimeError("Vout not found for address: txid=%s, addr=%s" % (txid, addr))