mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
Merge bitcoin/bitcoin#34154: test: Enable ruff E713 lint
fab300b378test: Enable ruff E713 lint (MarcoFalke) Pull request description: Membership tests of the form `not item in stuff` may be confusing, because they could be read as `(not item) in stuff`, which is different. So enable the ruff E713 lint, which should also help to avoid having to go through review cycles for this. ACKs for top commit: bensig: ACKfab300b378l0rinc: ACKfab300b378rkrux: lgtm crACKfab300b378Tree-SHA512: c3eaf0fbe0dd22d8e04b896e98adaf28162fb748e6f7f5ebfd73b2020da66046bf8f0c1a27db5da05250366b98ded8c4a55d53edd8fa050e80521aee42ba3c5a
This commit is contained in:
@@ -172,7 +172,7 @@ PE_ALLOWED_LIBRARIES = {
|
||||
def check_version(max_versions, version, arch) -> bool:
|
||||
(lib, _, ver) = version.rpartition('_')
|
||||
ver = tuple([int(x) for x in ver.split('.')])
|
||||
if not lib in max_versions:
|
||||
if lib not in max_versions:
|
||||
return False
|
||||
if isinstance(max_versions[lib], tuple):
|
||||
return ver <= max_versions[lib]
|
||||
|
||||
@@ -229,7 +229,7 @@ class BlockDataCopier:
|
||||
inExtent = BlockExtent(self.inFn, self.inF.tell(), inhdr, blk_hdr, inLen)
|
||||
|
||||
self.hash_str = calc_hash_str(blk_hdr)
|
||||
if not self.hash_str in blkmap:
|
||||
if self.hash_str not in blkmap:
|
||||
# Because blocks can be written to files out-of-order as of 0.10, the script
|
||||
# may encounter blocks it doesn't know about. Treat as debug output.
|
||||
if settings['debug_output'] == 'true':
|
||||
@@ -320,7 +320,7 @@ if __name__ == '__main__':
|
||||
blkmap = mkblockmap(blkindex)
|
||||
|
||||
# Block hash map won't be byte-reversed. Neither should the genesis hash.
|
||||
if not settings['genesis'] in blkmap:
|
||||
if settings['genesis'] not in blkmap:
|
||||
print("Genesis block not found in hashlist")
|
||||
else:
|
||||
BlockDataCopier(settings, blkindex, blkmap).run()
|
||||
|
||||
Reference in New Issue
Block a user