Skip to content

Commit

Permalink
test: Avoid logging error when logging error
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoFalke committed Dec 3, 2024
1 parent ebe4cac commit cccca8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/functional/test_framework/p2p.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2022 The Bitcoin Core developers
# Copyright (c) 2010-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test objects for interacting with a bitcoind node over the p2p protocol.
Expand Down Expand Up @@ -369,7 +369,7 @@ def _on_data(self):
self.on_message(t)
except Exception as e:
if not self.reconnect:
logger.exception('Error reading message:', repr(e))
logger.exception(f"Error reading message: {repr(e)}")
raise

def on_message(self, message):
Expand Down Expand Up @@ -659,7 +659,7 @@ def wait_for_getheaders(self, block_hash=None, *, timeout=60):
def test_function():
last_getheaders = self.last_message.pop("getheaders", None)
if block_hash is None:
return last_getheaders
return last_getheaders
if last_getheaders is None:
return False
return block_hash == last_getheaders.locator.vHave[0]
Expand Down
1 change: 1 addition & 0 deletions test/lint/test_runner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ fn lint_py_lint() -> LintResult {
"F822", // undefined name name in __all__
"F823", // local variable name … referenced before assignment
"F841", // local variable 'foo' is assigned to but never used
"PLE", // Pylint errors
"W191", // indentation contains tabs
"W291", // trailing whitespace
"W292", // no newline at end of file
Expand Down

0 comments on commit cccca8a

Please sign in to comment.