aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio
diff options
context:
space:
mode:
authorGravatar Nathaniel Manista <nathaniel@google.com>2017-01-20 16:42:03 -0800
committerGravatar GitHub <noreply@github.com>2017-01-20 16:42:03 -0800
commitc84725fd02dc58a819c8c4e8acdc321e81f44764 (patch)
tree91ad4bad444a4093378b0e9400db4c0fb426e6f1 /src/python/grpcio
parent2e225c1d8020835cc2edd7853c81710fda745a43 (diff)
parent7d561a6328caedaf7404af8d9015e465d3630810 (diff)
Merge pull request #9420 from nathanielmanistaatgoogle/time_remaining
Fix grpc._server._Context.time_remaining.
Diffstat (limited to 'src/python/grpcio')
-rw-r--r--src/python/grpcio/grpc/_server.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py
index 7b7b4d5dab..31551e0f1b 100644
--- a/src/python/grpcio/grpc/_server.py
+++ b/src/python/grpcio/grpc/_server.py
@@ -233,8 +233,9 @@ class _Context(grpc.ServicerContext):
return self._state.client is not _CANCELLED and not self._state.statused
def time_remaining(self):
- return max(self._rpc_event.request_call_details.deadline - time.time(),
- 0)
+ return max(
+ float(self._rpc_event.request_call_details.deadline) - time.time(),
+ 0)
def cancel(self):
self._rpc_event.operation_call.cancel()