Skip to content

Commit 05683f7

Browse files
authored
Shrink 'any-generics' whitelist for the cmd module (#10847)
1 parent 061c8ad commit 05683f7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ strict_optional = false
188188
module = [
189189
"sphinx.application",
190190
"sphinx.builders.*",
191-
"sphinx.cmd.*",
191+
"sphinx.cmd.quickstart",
192192
"sphinx.config",
193193
"sphinx.deprecation",
194194
"sphinx.domains.*",

sphinx/cmd/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import sys
1010
import traceback
1111
from os import path
12-
from typing import IO, Any, List, Optional, TextIO
12+
from typing import Any, List, Optional, TextIO
1313

1414
from docutils.utils import SystemMessage
1515

@@ -25,7 +25,7 @@
2525

2626

2727
def handle_exception(
28-
app: Optional[Sphinx], args: Any, exception: BaseException, stderr: IO = sys.stderr
28+
app: Optional[Sphinx], args: Any, exception: BaseException, stderr: TextIO = sys.stderr
2929
) -> None:
3030
if isinstance(exception, bdb.BdbQuit):
3131
return

sphinx/cmd/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _has_custom_template(self, template_name: str) -> bool:
177177
else:
178178
return False
179179

180-
def render(self, template_name: str, context: Dict) -> str:
180+
def render(self, template_name: str, context: Dict[str, Any]) -> str:
181181
if self._has_custom_template(template_name):
182182
custom_template = path.join(self.templatedir, path.basename(template_name))
183183
return self.render_from_file(custom_template, context)

0 commit comments

Comments
 (0)