Changeset View
Changeset View
Standalone View
Standalone View
test/functional/test_framework/test_node.py
Show First 20 Lines • Show All 720 Lines • ▼ Show 20 Lines | def send_cli(self, command=None, *args, **kwargs): | ||||
if match: | if match: | ||||
code, message = match.groups() | code, message = match.groups() | ||||
raise JSONRPCException(dict(code=int(code), message=message)) | raise JSONRPCException(dict(code=int(code), message=message)) | ||||
# Ignore cli_stdout, raise with cli_stderr | # Ignore cli_stdout, raise with cli_stderr | ||||
raise subprocess.CalledProcessError( | raise subprocess.CalledProcessError( | ||||
returncode, self.binary, output=cli_stderr) | returncode, self.binary, output=cli_stderr) | ||||
try: | try: | ||||
return json.loads(cli_stdout, parse_float=decimal.Decimal) | return json.loads(cli_stdout, parse_float=decimal.Decimal) | ||||
except json.JSONDecodeError: | except (json.JSONDecodeError, decimal.InvalidOperation): | ||||
return cli_stdout.rstrip("\n") | return cli_stdout.rstrip("\n") |