From e78866edf0422d81a66ceed63f591009cf5a3838 Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 19 Mar 2018 17:40:09 -0700 Subject: [PATCH] scripts/rpc.py: add parentheses to all print calls This is necessary for rpc.py to work with Python 3. Change-Id: I34d411090532ccc2603473ded20119681f8aa85a Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/404433 Reviewed-by: Dariusz Stojaczyk Reviewed-by: Paul Luse Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris Tested-by: SPDK Automated Test System --- scripts/rpc.py | 2 +- scripts/rpc/client.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/rpc.py b/scripts/rpc.py index 6eb3c0101..6f0439e18 100755 --- a/scripts/rpc.py +++ b/scripts/rpc.py @@ -12,7 +12,7 @@ except ImportError: def print_array(a): - print " ".join((quote(v) for v in a)) + print(" ".join((quote(v) for v in a))) if __name__ == "__main__": diff --git a/scripts/rpc/client.py b/scripts/rpc/client.py index ad565813a..6c902927b 100755 --- a/scripts/rpc/client.py +++ b/scripts/rpc/client.py @@ -4,7 +4,7 @@ import time def print_dict(d): - print json.dumps(d, indent=2) + print(json.dumps(d, indent=2)) class JSONRPCClient(object): @@ -70,17 +70,17 @@ class JSONRPCClient(object): if method == "kill_instance": exit(0) if closed: - print "Connection closed with partial response:" + print("Connection closed with partial response:") else: - print "Timeout while waiting for response:" - print buf + print("Timeout while waiting for response:") + print(buf) exit(1) if 'error' in response: - print "Got JSON-RPC error response" - print "request:" + print("Got JSON-RPC error response") + print("request:") print_dict(json.loads(reqstr)) - print "response:" + print("response:") print_dict(response['error']) exit(1)