fix(ci): resolve ruff SIM105, E501, W291 lint errors in PR #11197 changes
CI / lint (pull_request) Successful in 1m19s
CI / push-validation (pull_request) Successful in 39s
CI / helm (pull_request) Successful in 41s
CI / quality (pull_request) Successful in 1m41s
CI / typecheck (pull_request) Successful in 1m50s
CI / build (pull_request) Successful in 1m5s
CI / security (pull_request) Successful in 1m59s
CI / integration_tests (pull_request) Successful in 4m32s
CI / unit_tests (pull_request) Failing after 5m7s
CI / coverage (pull_request) Has been skipped
CI / docker (pull_request) Has been skipped
CI / status-check (pull_request) Failing after 3s

- events.py: add missing contextlib import, use contextlib.suppress for
  TypeError/AttributeError try/except (SIM105)
- reactive.py: fix docstring line length (E501), remove trailing whitespace (W291)
- logging_bus.py: fix docstring line length (E501), remove trailing whitespace (W291)
This commit is contained in:
CleverThis Bot
2026-05-15 01:44:13 +00:00
committed by Forgejo
parent 41d72d7ad5
commit 092c4e6437
3 changed files with 6 additions and 5 deletions
+2 -3
View File
@@ -15,6 +15,7 @@ publishes translated :class:`A2aEvent` instances to an event queue.
from __future__ import annotations
import contextlib
import json
from collections.abc import Callable
from typing import Any, ClassVar
@@ -277,10 +278,8 @@ class EventBusBridge:
if self._subscribed_types is None:
return
for et in self._subscribed_types:
try:
with contextlib.suppress(TypeError, AttributeError):
self._event_bus.unsubscribe(et, self._on_domain_event)
except (TypeError, AttributeError):
pass
self._subscribed_types = None
logger.info("a2a.event_bridge.stopped")
@@ -114,7 +114,8 @@ class LoggingEventBus:
Args:
event_type: The :class:`EventType` to stop listening for.
handler: The callable to remove (must be the same object passed to subscribe).
handler: Callable to remove (same object passed to
:meth:`subscribe`).
Returns:
True if the handler was found and removed, False otherwise.
@@ -173,7 +173,8 @@ class ReactiveEventBus:
Args:
event_type: The :class:`EventType` to stop listening for.
handler: The callable to remove (must be the same object passed to subscribe).
handler: Callable to remove (same object passed to
:meth:`subscribe`).
Returns:
True if the handler was found and removed, False otherwise.