mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-03 09:23:01 +01:00
script, test: fix python linter E275 errors with flake8 5.0.4
This commit is contained in:
@@ -36,7 +36,7 @@ def mini_parser(dat_file):
|
||||
"""
|
||||
with open(dat_file, 'rb') as f_in:
|
||||
# This should have at least one message in it
|
||||
assert(os.fstat(f_in.fileno()).st_size >= TIME_SIZE + LENGTH_SIZE + MSGTYPE_SIZE)
|
||||
assert os.fstat(f_in.fileno()).st_size >= TIME_SIZE + LENGTH_SIZE + MSGTYPE_SIZE
|
||||
while True:
|
||||
tmp_header_raw = f_in.read(TIME_SIZE + LENGTH_SIZE + MSGTYPE_SIZE)
|
||||
if not tmp_header_raw:
|
||||
@@ -44,7 +44,7 @@ def mini_parser(dat_file):
|
||||
tmp_header = BytesIO(tmp_header_raw)
|
||||
tmp_header.read(TIME_SIZE) # skip the timestamp field
|
||||
msgtype = tmp_header.read(MSGTYPE_SIZE).rstrip(b'\x00')
|
||||
assert(msgtype in MESSAGEMAP)
|
||||
assert msgtype in MESSAGEMAP
|
||||
length: int = int.from_bytes(tmp_header.read(LENGTH_SIZE), "little")
|
||||
data = f_in.read(length)
|
||||
assert_equal(len(data), length)
|
||||
|
||||
Reference in New Issue
Block a user