fix(ci): resolve ruff SIM105, E501, W291 lint errors in PR #11197 changes

- 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 07b294f2c8
commit b4e2551ec9
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.