File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 4848 from sphinx .application import Sphinx
4949 from sphinx .config import Config
5050 from sphinx .events import EventManager
51+ from sphinx .util ._pathlib import _StrPath
5152 from sphinx .util .tags import Tags
5253
5354
@@ -94,10 +95,10 @@ class Builder:
9495 supported_data_uri_images : bool = False
9596
9697 def __init__ (self , app : Sphinx , env : BuildEnvironment ) -> None :
97- self .srcdir = app .srcdir
98- self .confdir = app .confdir
99- self .outdir = app .outdir
100- self .doctreedir = app .doctreedir
98+ self .srcdir : _StrPath = app .srcdir
99+ self .confdir : _StrPath = app .confdir
100+ self .outdir : _StrPath = app .outdir
101+ self .doctreedir : _StrPath = app .doctreedir
101102 ensuredir (self .doctreedir )
102103
103104 self .app : Sphinx = app
Original file line number Diff line number Diff line change 3232
3333if TYPE_CHECKING :
3434 from collections .abc import Callable , Iterable , Iterator
35- from pathlib import Path
3635 from typing import Any , Literal
3736
3837 from docutils import nodes
@@ -102,8 +101,8 @@ class BuildEnvironment:
102101
103102 def __init__ (self , app : Sphinx ) -> None :
104103 self .app : Sphinx = app
105- self .doctreedir : Path = app .doctreedir
106- self .srcdir : Path = app .srcdir
104+ self .doctreedir : _StrPath = app .doctreedir
105+ self .srcdir : _StrPath = app .srcdir
107106 self .config : Config = None # type: ignore[assignment]
108107 self .config_status : int = CONFIG_UNSET
109108 self .config_status_extra : str = ''
Original file line number Diff line number Diff line change @@ -752,7 +752,7 @@ def visit_image(self, node: Element) -> None:
752752 # but it tries the final file name, which does not necessarily exist
753753 # yet at the time the HTML file is written.
754754 if not ('width' in node and 'height' in node ):
755- path = os .path .join (self .builder .srcdir , olduri ) # type: ignore[has-type]
755+ path = os .path .join (self .builder .srcdir , olduri )
756756 size = get_image_size (path )
757757 if size is None :
758758 logger .warning (
You can’t perform that action at this time.
0 commit comments