Skip to content

Commit cccca8a

Browse files
author
MarcoFalke
committed
test: Avoid logging error when logging error
1 parent ebe4cac commit cccca8a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/functional/test_framework/p2p.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22
# Copyright (c) 2010 ArtForz -- public domain half-a-node
33
# Copyright (c) 2012 Jeff Garzik
4-
# Copyright (c) 2010-2022 The Bitcoin Core developers
4+
# Copyright (c) 2010-present The Bitcoin Core developers
55
# Distributed under the MIT software license, see the accompanying
66
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
77
"""Test objects for interacting with a bitcoind node over the p2p protocol.
@@ -369,7 +369,7 @@ def _on_data(self):
369369
self.on_message(t)
370370
except Exception as e:
371371
if not self.reconnect:
372-
logger.exception('Error reading message:', repr(e))
372+
logger.exception(f"Error reading message: {repr(e)}")
373373
raise
374374

375375
def on_message(self, message):
@@ -659,7 +659,7 @@ def wait_for_getheaders(self, block_hash=None, *, timeout=60):
659659
def test_function():
660660
last_getheaders = self.last_message.pop("getheaders", None)
661661
if block_hash is None:
662-
return last_getheaders
662+
return last_getheaders
663663
if last_getheaders is None:
664664
return False
665665
return block_hash == last_getheaders.locator.vHave[0]

test/lint/test_runner/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ fn lint_py_lint() -> LintResult {
236236
"F822", // undefined name name in __all__
237237
"F823", // local variable name … referenced before assignment
238238
"F841", // local variable 'foo' is assigned to but never used
239+
"PLE", // Pylint errors
239240
"W191", // indentation contains tabs
240241
"W291", // trailing whitespace
241242
"W292", // no newline at end of file

0 commit comments

Comments
 (0)