From 04985650e706cbd46b4a79a0945e659fde5feaa2 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Tue, 18 Jul 2023 11:18:25 +0200 Subject: [PATCH] Remove broken Sphinx type annotation sphinx.directives.T has been removed upstream. This commit removes the type annotation to avoid breaking the extension with Sphinx >= 6 --- jandd/sphinxext/ip/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jandd/sphinxext/ip/__init__.py b/jandd/sphinxext/ip/__init__.py index 9fc18b7..8764328 100644 --- a/jandd/sphinxext/ip/__init__.py +++ b/jandd/sphinxext/ip/__init__.py @@ -20,7 +20,7 @@ from sphinx import addnodes from sphinx.addnodes import desc_signature, pending_xref from sphinx.application import Sphinx from sphinx.builders import Builder -from sphinx.directives import ObjectDescription, T +from sphinx.directives import ObjectDescription from sphinx.domains import Domain, ObjType from sphinx.environment import BuildEnvironment from sphinx.errors import NoUri @@ -63,7 +63,7 @@ class IPRangeDirective(ObjectDescription): class IPV4RangeDirective(IPRangeDirective): title_prefix = _("IPv4 range") - def add_target_and_index(self, name: T, sig: str, sig_node: desc_signature) -> None: + def add_target_and_index(self, name, sig: str, sig_node: desc_signature) -> None: anchor = "ip-ipv4range-{0}".format(sig) sig_node["ids"].append(anchor) ips = cast(IPDomain, self.env.get_domain("ip")) @@ -77,7 +77,7 @@ class IPV4RangeDirective(IPRangeDirective): class IPV6RangeDirective(IPRangeDirective): title_prefix = _("IPv6 range") - def add_target_and_index(self, name: T, sig: str, signode: desc_signature) -> None: + def add_target_and_index(self, name, sig: str, signode: desc_signature) -> None: anchor = "ip-ipv6range-{0}".format(sig) signode["ids"].append(anchor) ips = cast(IPDomain, self.env.get_domain("ip"))