Skip to content

Commit 40dc8b8

Browse files
committed
Use the _StrPath proxy for sphinx.builders
1 parent 3930a1c commit 40dc8b8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

sphinx/builders/__init__.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
rst,
2424
)
2525
from sphinx.util._importer import import_object
26+
from sphinx.util._pathlib import _StrPathProperty
2627
from sphinx.util.build_phase import BuildPhase
2728
from sphinx.util.console import bold
2829
from sphinx.util.display import progress_message, status_iterator
@@ -48,7 +49,6 @@
4849
from sphinx.application import Sphinx
4950
from sphinx.config import Config
5051
from sphinx.events import EventManager
51-
from sphinx.util._pathlib import _StrPath
5252
from sphinx.util.tags import Tags
5353

5454

@@ -94,11 +94,16 @@ class Builder:
9494
#: The file format produced by the builder allows images to be embedded using data-URIs.
9595
supported_data_uri_images: bool = False
9696

97+
srcdir = _StrPathProperty()
98+
confdir = _StrPathProperty()
99+
outdir = _StrPathProperty()
100+
doctreedir = _StrPathProperty()
101+
97102
def __init__(self, app: Sphinx, env: BuildEnvironment) -> None:
98-
self.srcdir: _StrPath = app.srcdir
99-
self.confdir: _StrPath = app.confdir
100-
self.outdir: _StrPath = app.outdir
101-
self.doctreedir: _StrPath = app.doctreedir
103+
self.srcdir = app.srcdir
104+
self.confdir = app.confdir
105+
self.outdir = app.outdir
106+
self.doctreedir = app.doctreedir
102107
ensuredir(self.doctreedir)
103108

104109
self.app: Sphinx = app

0 commit comments

Comments
 (0)