mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
Merge bitcoin/bitcoin#25867: lint: enable E722 do not use bare except
61bb4e783b
lint: enable E722 do not use bare except (Leonardo Lazzaro) Pull request description: Improve test code and enable E722 lint check. If you want to catch all exceptions that signal program errors, use except Exception: (bare except is equivalent to except BaseException:). Reference: https://peps.python.org/pep-0008/#programming-recommendations ACKs for top commit: MarcoFalke: lgtm ACK61bb4e783b
Tree-SHA512: c7497769d5745fa02c78a20f4a0e555d8d3996d64af6faf1ce28e22ac1d8be415b98e967294679007b7bda2a9fd04031a9d140b24201e00257ceadeb5c5d7665
This commit is contained in:
@@ -54,7 +54,7 @@ def bctester(testDir, input_basename, buildenv):
|
||||
try:
|
||||
bctest(testDir, testObj, buildenv)
|
||||
logging.info("PASSED: " + testObj["description"])
|
||||
except:
|
||||
except Exception:
|
||||
logging.info("FAILED: " + testObj["description"])
|
||||
failed_testcases.append(testObj["description"])
|
||||
|
||||
@@ -96,7 +96,7 @@ def bctest(testDir, testObj, buildenv):
|
||||
try:
|
||||
with open(os.path.join(testDir, outputFn), encoding="utf8") as f:
|
||||
outputData = f.read()
|
||||
except:
|
||||
except Exception:
|
||||
logging.error("Output file " + outputFn + " cannot be opened")
|
||||
raise
|
||||
if not outputData:
|
||||
|
Reference in New Issue
Block a user