File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99from sphinx .errors import ThemeError
1010
1111if TYPE_CHECKING :
12- from sphinx . util . _pathlib import _StrPath
12+ from pathlib import Path
1313
1414
1515class _CascadingStyleSheet :
@@ -124,7 +124,7 @@ def __getitem__(self, key):
124124 return os .fspath (self .filename )[key ]
125125
126126
127- def _file_checksum (outdir : _StrPath , filename : str | os .PathLike [str ]) -> str :
127+ def _file_checksum (outdir : Path , filename : str | os .PathLike [str ]) -> str :
128128 filename = os .fspath (filename )
129129 # Don't generate checksums for HTTP URIs
130130 if '://' in filename :
Original file line number Diff line number Diff line change 2424
2525if TYPE_CHECKING :
2626 from collections .abc import Generator , Iterator
27+ from pathlib import Path
2728
2829 from docutils import nodes
2930 from docutils .nodes import Node
3435 from sphinx .domains import Domain
3536 from sphinx .events import EventManager
3637 from sphinx .project import Project
37- from sphinx .util ._pathlib import _StrPath
3838
3939logger = logging .getLogger (__name__ )
4040
@@ -148,8 +148,8 @@ class BuildEnvironment:
148148
149149 def __init__ (self , app : Sphinx ):
150150 self .app : Sphinx = app
151- self .doctreedir : _StrPath = app .doctreedir
152- self .srcdir : _StrPath = app .srcdir
151+ self .doctreedir : Path = app .doctreedir
152+ self .srcdir : Path = app .srcdir
153153 self .config : Config = None # type: ignore[assignment]
154154 self .config_status : int = CONFIG_UNSET
155155 self .config_status_extra : str = ''
Original file line number Diff line number Diff line change 1717
1818if TYPE_CHECKING :
1919 from io import StringIO
20+ from pathlib import Path
2021
2122 from docutils .nodes import Node
2223
23- from sphinx .util ._pathlib import _StrPath
24-
2524__all__ = 'SphinxTestApp' , 'SphinxTestAppWrapperForSkipBuilding'
2625
2726
@@ -82,8 +81,8 @@ class SphinxTestApp(application.Sphinx):
8281 def __init__ (
8382 self ,
8483 buildername : str = 'html' ,
85- srcdir : _StrPath | None = None ,
86- builddir : _StrPath | None = None ,
84+ srcdir : Path | None = None ,
85+ builddir : Path | None = None ,
8786 freshenv : bool = False ,
8887 confoverrides : dict | None = None ,
8988 status : IO | None = None ,
You can’t perform that action at this time.
0 commit comments