Skip to content

Commit 7fbd553

Browse files
committed
Use the _StrPath proxy for sphinx.environment
1 parent 40dc8b8 commit 7fbd553

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sphinx/environment/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from sphinx.transforms import SphinxTransformer
2323
from sphinx.util import logging
2424
from sphinx.util._files import DownloadFiles, FilenameUniqDict
25+
from sphinx.util._pathlib import _StrPathProperty
2526
from sphinx.util._serialise import stable_str
2627
from sphinx.util._timestamps import _format_rfc3339_microseconds
2728
from sphinx.util.docutils import LoggingReporter
@@ -98,10 +99,13 @@ class BuildEnvironment:
9899

99100
# --------- ENVIRONMENT INITIALIZATION -------------------------------------
100101

102+
srcdir = _StrPathProperty()
103+
doctreedir = _StrPathProperty()
104+
101105
def __init__(self, app: Sphinx) -> None:
102106
self.app: Sphinx = app
103-
self.doctreedir: _StrPath = app.doctreedir
104-
self.srcdir: _StrPath = app.srcdir
107+
self.doctreedir = app.doctreedir
108+
self.srcdir = app.srcdir
105109
self.config: Config = None # type: ignore[assignment]
106110
self.config_status: int = CONFIG_UNSET
107111
self.config_status_extra: str = ''

0 commit comments

Comments
 (0)