diff options
author | fanquake <fanquake@gmail.com> | 2023-02-22 09:26:23 +0000 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2023-02-22 09:28:09 +0000 |
commit | 0c579203d265e4c74a0b1fc33147bf85ef16d56a (patch) | |
tree | 3b8b23cbc75f929e81a52555c5c05243743651ff /test/functional/feature_dbcrash.py | |
parent | 80f4979322b574be29c684b2e106804432420ebf (diff) | |
parent | 61bb4e783b3acc62b121a228f6b14c2462e23315 (diff) |
Merge bitcoin/bitcoin#25867: lint: enable E722 do not use bare except
61bb4e783b3acc62b121a228f6b14c2462e23315 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 ACK 61bb4e783b3acc62b121a228f6b14c2462e23315
Tree-SHA512: c7497769d5745fa02c78a20f4a0e555d8d3996d64af6faf1ce28e22ac1d8be415b98e967294679007b7bda2a9fd04031a9d140b24201e00257ceadeb5c5d7665
Diffstat (limited to 'test/functional/feature_dbcrash.py')
-rwxr-xr-x | test/functional/feature_dbcrash.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/feature_dbcrash.py b/test/functional/feature_dbcrash.py index e2bc566f53..1f2e0936ed 100755 --- a/test/functional/feature_dbcrash.py +++ b/test/functional/feature_dbcrash.py @@ -85,7 +85,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework): self.nodes[node_index].waitforblock(expected_tip) utxo_hash = self.nodes[node_index].gettxoutsetinfo()['hash_serialized_2'] return utxo_hash - except: + except Exception: # An exception here should mean the node is about to crash. # If bitcoind exits, then try again. wait_for_node_exit() # should raise an exception if bitcoind doesn't exit. |