test: refactor: remove unnecessary nonlocal

Since we're only mutating, and not reassigning, we don't need to
declare `events` as `nonlocal`.
pull/27944/head
stickies-v 1 year ago
parent 326db63a68
commit bc43270450
No known key found for this signature in database
GPG Key ID: 5CB1CE6E5E66A757

@ -139,7 +139,6 @@ class NetTracepointTest(BitcoinTestFramework):
checked_outbound_version_msg += 1
def handle_inbound(_, data, __):
nonlocal events
event = ctypes.cast(data, ctypes.POINTER(P2PMessage)).contents
events.append((event, True))

@ -97,7 +97,6 @@ class ValidationTracepointTest(BitcoinTestFramework):
usdt_contexts=[ctx], debug=0)
def handle_blockconnected(_, data, __):
nonlocal events
event = ctypes.cast(data, ctypes.POINTER(Block)).contents
self.log.info(f"handle_blockconnected(): {event}")
events.append(event)

Loading…
Cancel
Save