From 2e7ada2b6de96e65da7f60db1b3e620782e11b60 Mon Sep 17 00:00:00 2001 From: Goffi Date: Tue, 13 Jan 2026 10:56:53 +0100 Subject: [PATCH] core (xmpp): Fix type hints for Tor: The type hints were using `Tor` directly, causing a failure if `txtorcon` was not installed. This patch fixes it by using a type hints string instead. --- libervia/backend/core/xmpp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libervia/backend/core/xmpp.py b/libervia/backend/core/xmpp.py index f31d04d0..16ab24be 100644 --- a/libervia/backend/core/xmpp.py +++ b/libervia/backend/core/xmpp.py @@ -257,7 +257,7 @@ class SatXMPPEntity(core_types.SatXMPPEntity): timer["total"] += timer["connected"] @staticmethod - async def _prepare_tor() -> Tor: + async def _prepare_tor() -> "Tor": log.debug("We have an .onion domain, we use Tor to connect.") if txtorcon is None: raise exceptions.MissingModule( @@ -1039,7 +1039,7 @@ class SatXMPPClient(SatXMPPEntity, core_types.SatXMPPClient, wokkel_client.XMPPC host=None, port=C.XMPP_C2S_PORT, max_retries=C.XMPP_MAX_RETRIES, - tor: Tor | None = None, + tor: "Tor | None" = None, ): # XXX: DNS SRV records are checked when the host is not specified. # If no SRV record is found, the host is directly extracted from the JID.