Skip to content

Commit

Permalink
Use the _StrPath proxy for sphinx.environment
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Nov 27, 2024
1 parent 40dc8b8 commit 7fbd553
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sphinx/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from sphinx.transforms import SphinxTransformer
from sphinx.util import logging
from sphinx.util._files import DownloadFiles, FilenameUniqDict
from sphinx.util._pathlib import _StrPathProperty
from sphinx.util._serialise import stable_str
from sphinx.util._timestamps import _format_rfc3339_microseconds
from sphinx.util.docutils import LoggingReporter
Expand Down Expand Up @@ -98,10 +99,13 @@ class BuildEnvironment:

# --------- ENVIRONMENT INITIALIZATION -------------------------------------

srcdir = _StrPathProperty()
doctreedir = _StrPathProperty()

def __init__(self, app: Sphinx) -> None:
self.app: Sphinx = app
self.doctreedir: _StrPath = app.doctreedir
self.srcdir: _StrPath = app.srcdir
self.doctreedir = app.doctreedir
self.srcdir = app.srcdir
self.config: Config = None # type: ignore[assignment]
self.config_status: int = CONFIG_UNSET
self.config_status_extra: str = ''
Expand Down

0 comments on commit 7fbd553

Please sign in to comment.