Skip to content

Commit

Permalink
Fix the type for the context in the async exception to status interce…
Browse files Browse the repository at this point in the history
…ptor (#37)

* fix the type for the context in the async exception to status interceptor. (#36)

* bump version number

* Bump patch version

---------

Co-authored-by: Dan Hipschman <d5h@users.noreply.github.com>
  • Loading branch information
jeffsawatzky and d5h authored May 18, 2023
1 parent 9f79f5b commit f1b49a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "grpc-interceptor"
version = "0.15.1"
version = "0.15.2"
description = "Simplifies gRPC interceptors"
license = "MIT"
readme = "README.md"
Expand Down
7 changes: 4 additions & 3 deletions src/grpc_interceptor/exception_to_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)

import grpc
from grpc import aio as grpc_aio

from grpc_interceptor.exceptions import GrpcException
from grpc_interceptor.server import AsyncServerInterceptor, ServerInterceptor
Expand Down Expand Up @@ -134,7 +135,7 @@ def __init__(self, status_on_unknown_exception: Optional[grpc.StatusCode] = None
async def _generate_responses(
self,
request_or_iterator: Any,
context: grpc.ServicerContext,
context: grpc_aio.ServicerContext,
method_name: str,
response_iterator: AsyncIterable,
) -> AsyncGenerator[Any, None]:
Expand All @@ -149,7 +150,7 @@ async def handle_exception(
self,
ex: Exception,
request_or_iterator: Any,
context: grpc.ServicerContext,
context: grpc_aio.ServicerContext,
method_name: str,
) -> None:
"""Override this if extending ExceptionToStatusInterceptor.
Expand Down Expand Up @@ -180,7 +181,7 @@ async def intercept(
self,
method: Callable,
request_or_iterator: Any,
context: grpc.ServicerContext,
context: grpc_aio.ServicerContext,
method_name: str,
) -> Any:
"""Do not call this directly; use the interceptor kwarg on grpc.server()."""
Expand Down

0 comments on commit f1b49a4

Please sign in to comment.