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/testing/util.py | |
parent | 26f79b0d2dd88b353ac65623897bdfbe8bc07cab (diff) | |
download | sphinx-git-14a9289d780240bbce78ad3640e8e1b1b12df43f.tar.gz |
Use PEP 604 types
Diffstat (limited to 'sphinx/testing/util.py')
-rw-r--r-- | sphinx/testing/util.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sphinx/testing/util.py b/sphinx/testing/util.py index 6c5012c26..4e99c50ef 100644 --- a/sphinx/testing/util.py +++ b/sphinx/testing/util.py @@ -7,7 +7,7 @@ import re import sys import warnings from io import StringIO -from typing import IO, Any, Generator, Optional +from typing import IO, Any, Generator from xml.etree import ElementTree from docutils import nodes @@ -99,14 +99,14 @@ class SphinxTestApp(application.Sphinx): def __init__( self, buildername: str = 'html', - srcdir: Optional[path] = None, - builddir: Optional[path] = None, + srcdir: path | None = None, + builddir: path | None = None, freshenv: bool = False, - confoverrides: Optional[dict] = None, - status: Optional[IO] = None, - warning: Optional[IO] = None, - tags: Optional[list[str]] = None, - docutilsconf: Optional[str] = None, + confoverrides: dict | None = None, + status: IO | None = None, + warning: IO | None = None, + tags: list[str] | None = None, + docutilsconf: str | None = None, parallel: int = 0 ) -> None: @@ -180,7 +180,7 @@ class SphinxTestAppWrapperForSkipBuilding: _unicode_literals_re = re.compile(r'u(".*?")|u(\'.*?\')') -def find_files(root: str, suffix: Optional[str] = None) -> Generator[str, None, None]: +def find_files(root: str, suffix: str | None = None) -> Generator[str, None, None]: for dirpath, _dirs, files in os.walk(root, followlinks=True): dirpath = path(dirpath) for f in [f for f in files if not suffix or f.endswith(suffix)]: |