mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
test: Handle empty string returned by CLI as None in RPC tests
This commit is contained in:
parent
cdc32994fe
commit
a4041c77f0
1 changed files with 2 additions and 0 deletions
|
@ -919,6 +919,8 @@ class TestNodeCLI():
|
|||
# Ignore cli_stdout, raise with cli_stderr
|
||||
raise subprocess.CalledProcessError(returncode, p_args, 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…
Add table
Reference in a new issue