Skip to content

Commit e23db32

Browse files
author
Christian Knittl-Frank
committed
Use new annotation style
1 parent f676927 commit e23db32

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/sphinxcontrib/email/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
from typing import Any, Dict
1+
from __future__ import annotations
2+
3+
from typing import Any
24

35
from sphinx.application import Sphinx
46
from sphinx.util import logging
@@ -19,7 +21,7 @@
1921
logger = logging.getLogger("sphinxcontrib-email")
2022

2123

22-
def setup(app: Sphinx) -> Dict[str, Any]:
24+
def setup(app: Sphinx) -> dict[str, Any]:
2325
app.add_config_value(name="email_automode", default=False, rebuild="env")
2426
app.connect(event="html-page-context", callback=html_page_context_handler)
2527
app.add_role(name="email", role=EmailRole())

src/sphinxcontrib/email/handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Dict
1+
from __future__ import annotations
22

33
import lxml.html # nosec # noqa DUO107
44
from sphinx.application import Sphinx
@@ -10,7 +10,7 @@
1010

1111

1212
def html_page_context_handler(
13-
app: Sphinx, pagename: str, templatename: str, context: Dict, doctree: bool
13+
app: Sphinx, pagename: str, templatename: str, context: dict, doctree: bool
1414
):
1515
"""Search html for 'mailto' links and obfuscate them"""
1616
if not app.config["email_automode"]:

src/sphinxcontrib/email/roles.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
import re
2-
from typing import List, Tuple
34

45
from docutils import nodes
56
from docutils.nodes import Node, system_message
@@ -12,7 +13,7 @@
1213

1314

1415
class EmailRole(SphinxRole):
15-
def run(self) -> Tuple[List[Node], List[system_message]]:
16+
def run(self) -> tuple[list[Node], list[system_message]]:
1617
"""Role to obfuscate e-mail addresses.
1718
1819
Handle addresses of the form

src/sphinxcontrib/email/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import re
24
import textwrap
35
import xml.sax.saxutils # nosec

0 commit comments

Comments
 (0)