mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-01 11:11:22 +00:00
test: Handle empty string returned by CLI as None in RPC tests
Github-Pull: #32286 Rebased-From: a4041c77f0e20d004524868e70ff12508832c9eb
This commit is contained in:
parent
1e7041a9f3
commit
992c7cad46
@ -887,6 +887,8 @@ class TestNodeCLI():
|
||||
# Ignore cli_stdout, raise with cli_stderr
|
||||
raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
|
||||
try:
|
||||
if not cli_stdout.strip():
|
||||
return None
|
||||
return json.loads(cli_stdout, parse_float=decimal.Decimal)
|
||||
except (json.JSONDecodeError, decimal.InvalidOperation):
|
||||
return cli_stdout.rstrip("\n")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user