diff options
author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-01-01 20:43:59 +0000 |
---|---|---|
committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2023-01-01 20:48:39 +0000 |
commit | 14a9289d780240bbce78ad3640e8e1b1b12df43f (patch) | |
tree | fd753f5b0f8c7053923b78c8fef2b90b60f9c7fa /sphinx/highlighting.py | |
parent | 26f79b0d2dd88b353ac65623897bdfbe8bc07cab (diff) | |
download | sphinx-git-14a9289d780240bbce78ad3640e8e1b1b12df43f.tar.gz |
Use PEP 604 types
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index a8ec62cb6..7ed933f43 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -4,7 +4,7 @@ from __future__ import annotations from functools import partial from importlib import import_module -from typing import Any, Optional, Union +from typing import Any, Union from pygments import highlight from pygments.filters import ErrorToken @@ -83,7 +83,7 @@ class PygmentsBridge: latex_formatter = LatexFormatter def __init__(self, dest: str = 'html', stylename: str = 'sphinx', - latex_engine: Optional[str] = None) -> None: + latex_engine: str | None = None) -> None: self.dest = dest self.latex_engine = latex_engine @@ -110,7 +110,7 @@ class PygmentsBridge: kwargs.update(self.formatter_args) return self.formatter(**kwargs) - def get_lexer(self, source: str, lang: str, opts: Optional[dict] = None, + def get_lexer(self, source: str, lang: str, opts: dict | None = None, force: bool = False, location: Any = None) -> Lexer: if not opts: opts = {} @@ -146,7 +146,7 @@ class PygmentsBridge: return lexer - def highlight_block(self, source: str, lang: str, opts: Optional[dict] = None, + def highlight_block(self, source: str, lang: str, opts: dict | None = None, force: bool = False, location: Any = None, **kwargs: Any) -> str: if not isinstance(source, str): source = source.decode() |