diff options
author | Nathaniel Manista <nathaniel@google.com> | 2017-01-20 16:42:03 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-20 16:42:03 -0800 |
commit | c84725fd02dc58a819c8c4e8acdc321e81f44764 (patch) | |
tree | 91ad4bad444a4093378b0e9400db4c0fb426e6f1 /src/python/grpcio | |
parent | 2e225c1d8020835cc2edd7853c81710fda745a43 (diff) | |
parent | 7d561a6328caedaf7404af8d9015e465d3630810 (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.py | 5 |
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() |