Skip to content

Commit d178a53

Browse files
committed
Use the right types in {Dummy,Fake}Application
1 parent b6b01c2 commit d178a53

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sphinx/ext/autosummary/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
import re
5858
import sys
5959
from inspect import Parameter
60+
from pathlib import Path
6061
from types import ModuleType
6162
from typing import TYPE_CHECKING, Any, ClassVar, cast
6263

@@ -154,10 +155,10 @@ class FakeApplication:
154155
verbosity = 0
155156

156157
def __init__(self) -> None:
157-
self.doctreedir = None
158+
self.doctreedir = Path()
158159
self.events = None
159160
self.extensions: dict[str, Extension] = {}
160-
self.srcdir = None
161+
self.srcdir = Path()
161162
self.config = Config()
162163
self.project = Project('', {})
163164
self.registry = SphinxComponentRegistry()

sphinx/ext/autosummary/generate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
from sphinx.pycode import ModuleAnalyzer
4747
from sphinx.registry import SphinxComponentRegistry
4848
from sphinx.util import logging, rst
49+
from sphinx.util._pathlib import _StrPath
4950
from sphinx.util.inspect import getall, safe_getattr
5051
from sphinx.util.osutil import ensuredir
5152
from sphinx.util.template import SphinxTemplateLoader
@@ -67,7 +68,7 @@ def __init__(self, translator: NullTranslations) -> None:
6768
self.config = Config()
6869
self.registry = SphinxComponentRegistry()
6970
self.messagelog: list[str] = []
70-
self.srcdir = '/'
71+
self.srcdir = _StrPath('/')
7172
self.translator = translator
7273
self.verbosity = 0
7374
self._warncount = 0

0 commit comments

Comments
 (0)