rpc/client.py: replace use process_time() instead of time()
time.clock() was depreceted since Python 3.3 and was finally removed in Python 3.8. https://docs.python.org/3.8/whatsnew/3.8.html#api-and-feature-removals Signed-off-by: Karol Latecki <karol.latecki@intel.com> Change-Id: I3ffe372b61c8afc0ddbbee0064b95059fa184616 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1369 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
fdba47584a
commit
051a6902d8
@ -120,11 +120,11 @@ class JSONRPCClient(object):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def recv(self):
|
def recv(self):
|
||||||
start_time = time.clock()
|
start_time = time.process_time()
|
||||||
response = self.decode_one_response()
|
response = self.decode_one_response()
|
||||||
while not response:
|
while not response:
|
||||||
try:
|
try:
|
||||||
timeout = self.timeout - (time.clock() - start_time)
|
timeout = self.timeout - (time.process_time() - start_time)
|
||||||
self.sock.settimeout(timeout)
|
self.sock.settimeout(timeout)
|
||||||
newdata = self.sock.recv(4096)
|
newdata = self.sock.recv(4096)
|
||||||
if not newdata:
|
if not newdata:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user