mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 02:11:24 +02:00
test, contrib, refactor: use with
when opening a file
This commit is contained in:
@ -58,7 +58,8 @@ class VersionBitsWarningTest(BitcoinTestFramework):
|
||||
|
||||
def versionbits_in_alert_file(self):
|
||||
"""Test that the versionbits warning has been written to the alert file."""
|
||||
alert_text = open(self.alert_filename, 'r', encoding='utf8').read()
|
||||
with open(self.alert_filename, 'r', encoding='utf8') as f:
|
||||
alert_text = f.read()
|
||||
return VB_PATTERN.search(alert_text) is not None
|
||||
|
||||
def run_test(self):
|
||||
|
Reference in New Issue
Block a user