diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-17 00:21:08 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-22 02:09:49 +0900 |
commit | 63fbfb02f1c30016a6c9251443f2621d2b9700eb (patch) | |
tree | 03052317a0c12bdab9f7008b60f2545648e5ff32 /sphinx/application.py | |
parent | b19dc365fe8d2875793c3b8490e0c006a9c65329 (diff) | |
download | sphinx-git-63fbfb02f1c30016a6c9251443f2621d2b9700eb.tar.gz |
refactor: Make the app argument for BuildEnvironment required
At present, some attributes of env object are considered as optional
because they have been initialized by None on the constructor. But
they have always been fullfilled actually.
To be clear the type hints of the env object, this makes the `app`
argument for the BuildEnvironment class required. It can ensure the
attributes of env object are not optional.
Diffstat (limited to 'sphinx/application.py')
-rw-r--r-- | sphinx/application.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sphinx/application.py b/sphinx/application.py index 07049ffcd..4aeca54f4 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -300,8 +300,7 @@ class Sphinx: def _init_env(self, freshenv: bool) -> None: filename = path.join(self.doctreedir, ENV_PICKLE_FILENAME) if freshenv or not os.path.exists(filename): - self.env = BuildEnvironment() - self.env.setup(self) + self.env = BuildEnvironment(self) self.env.find_files(self.config, self.builder) else: try: |