Skip to content

Commit a4041c7

Browse files
test: Handle empty string returned by CLI as None in RPC tests
1 parent cdc3299 commit a4041c7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/test_framework/test_node.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ def send_cli(self, clicommand=None, *args, **kwargs):
919919
# Ignore cli_stdout, raise with cli_stderr
920920
raise subprocess.CalledProcessError(returncode, p_args, output=cli_stderr)
921921
try:
922+
if not cli_stdout.strip():
923+
return None
922924
return json.loads(cli_stdout, parse_float=decimal.Decimal)
923925
except (json.JSONDecodeError, decimal.InvalidOperation):
924926
return cli_stdout.rstrip("\n")

0 commit comments

Comments
 (0)