diff --git a/src/python/grpcio/grpc/experimental/aio/_channel.py b/src/python/grpcio/grpc/experimental/aio/_channel.py index 3aa9fc07360..159c74981ea 100644 --- a/src/python/grpcio/grpc/experimental/aio/_channel.py +++ b/src/python/grpcio/grpc/experimental/aio/_channel.py @@ -96,7 +96,7 @@ class UnaryUnaryMultiCallable: if not self._interceptors: return UnaryUnaryCall( request, - _timeout_to_deadline(self._loop, timeout), + _timeout_to_deadline(timeout), self._channel, self._method, self._request_serializer, @@ -166,7 +166,7 @@ class UnaryStreamMultiCallable: if compression: raise NotImplementedError("TODO: compression not implemented yet") - deadline = _timeout_to_deadline(self._loop, timeout) + deadline = _timeout_to_deadline(timeout) return UnaryStreamCall( request, diff --git a/src/python/grpcio/grpc/experimental/aio/_interceptor.py b/src/python/grpcio/grpc/experimental/aio/_interceptor.py index dc25f4933c6..e90e90955ae 100644 --- a/src/python/grpcio/grpc/experimental/aio/_interceptor.py +++ b/src/python/grpcio/grpc/experimental/aio/_interceptor.py @@ -147,8 +147,7 @@ class InterceptedUnaryUnaryCall(_base_call.UnaryUnaryCall): else: return UnaryUnaryCall( request, - _timeout_to_deadline(self._loop, - client_call_details.timeout), + _timeout_to_deadline(client_call_details.timeout), self._channel, client_call_details.method, request_serializer, response_deserializer) diff --git a/src/python/grpcio/grpc/experimental/aio/_utils.py b/src/python/grpcio/grpc/experimental/aio/_utils.py index 6a1f81a5ed7..e5772dce2da 100644 --- a/src/python/grpcio/grpc/experimental/aio/_utils.py +++ b/src/python/grpcio/grpc/experimental/aio/_utils.py @@ -12,13 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. """Internal utilities used by the gRPC Aio module.""" -import asyncio import time from typing import Optional -def _timeout_to_deadline(loop: asyncio.AbstractEventLoop, - timeout: Optional[float]) -> Optional[float]: +def _timeout_to_deadline(timeout: Optional[float]) -> Optional[float]: if timeout is None: return None return time.time() + timeout