diff options
Diffstat (limited to 'sphinx/builders/__init__.py')
-rw-r--r-- | sphinx/builders/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index bedc65b61..722f9a280 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -11,7 +11,8 @@ import pickle import time from os import path -from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Sequence, Set, Tuple, Type, Union +from typing import (TYPE_CHECKING, Any, Dict, Iterable, List, Optional, Sequence, Set, Tuple, + Type, Union) from docutils import nodes from docutils.nodes import Node @@ -88,7 +89,7 @@ class Builder: ensuredir(self.doctreedir) self.app: Sphinx = app - self.env: BuildEnvironment = None + self.env: Optional[BuildEnvironment] = None self.events: EventManager = app.events self.config: Config = app.config self.tags: Tags = app.tags @@ -225,7 +226,7 @@ class Builder: self.compile_catalogs(set(repo.catalogs), message) def compile_specific_catalogs(self, specified_files: List[str]) -> None: - def to_domain(fpath: str) -> str: + def to_domain(fpath: str) -> Optional[str]: docname = self.env.path2doc(path.abspath(fpath)) if docname: return docname_to_domain(docname, self.config.gettext_compact) |