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.
This commit is contained in:
Goffi 2026-01-13 10:56:53 +01:00
commit 2e7ada2b6d

View file

@ -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.