Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Aug 11, 2023
1 parent 12583e6 commit 231199c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/service-library/src/servicelib/rabbitmq.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import asyncio
import logging
from collections.abc import Awaitable, Callable
from dataclasses import dataclass, field
from typing import Any, Awaitable, Callable, Final, Protocol
from typing import Any, Final, Protocol

import aio_pika
import aiormq
Expand Down Expand Up @@ -313,7 +314,7 @@ async def rpc_request(
method_name: RPCMethodName,
*,
timeout_s: PositiveInt | None = 5,
**kwargs: dict[str, Any],
**kwargs,
) -> Any:
"""
Call a remote registered `handler` by providing it's `namespace`, `method_name`
Expand All @@ -327,7 +328,7 @@ async def rpc_request(
"""

if not self._rpc:
raise RPCNotInitializedError()
raise RPCNotInitializedError

namespaced_method_name = RPCNamespacedMethodName.from_namespace_and_method(
namespace, method_name
Expand Down Expand Up @@ -362,7 +363,7 @@ async def rpc_register_handler(
"""

if self._rpc is None:
raise RPCNotInitializedError()
raise RPCNotInitializedError

await self._rpc.register(
RPCNamespacedMethodName.from_namespace_and_method(namespace, method_name),
Expand All @@ -374,6 +375,6 @@ async def rpc_unregister_handler(self, handler: Callable[..., Any]) -> None:
"""Unbind a locally added `handler`"""

if self._rpc is None:
raise RPCNotInitializedError()
raise RPCNotInitializedError

await self._rpc.unregister(handler)

0 comments on commit 231199c

Please sign in to comment.