Shrink 'any-generics' whitelist for the cmd module (#10847)

This commit is contained in:
danieleades 2022-09-27 17:56:35 +01:00 committed by GitHub
parent 061c8ad528
commit 05683f794c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -188,7 +188,7 @@ strict_optional = false
module = [ module = [
"sphinx.application", "sphinx.application",
"sphinx.builders.*", "sphinx.builders.*",
"sphinx.cmd.*", "sphinx.cmd.quickstart",
"sphinx.config", "sphinx.config",
"sphinx.deprecation", "sphinx.deprecation",
"sphinx.domains.*", "sphinx.domains.*",

View File

@ -9,7 +9,7 @@ import pdb
import sys import sys
import traceback import traceback
from os import path from os import path
from typing import IO, Any, List, Optional, TextIO from typing import Any, List, Optional, TextIO
from docutils.utils import SystemMessage from docutils.utils import SystemMessage
@ -25,7 +25,7 @@ from sphinx.util.osutil import abspath, ensuredir
def handle_exception( def handle_exception(
app: Optional[Sphinx], args: Any, exception: BaseException, stderr: IO = sys.stderr app: Optional[Sphinx], args: Any, exception: BaseException, stderr: TextIO = sys.stderr
) -> None: ) -> None:
if isinstance(exception, bdb.BdbQuit): if isinstance(exception, bdb.BdbQuit):
return return

View File

@ -177,7 +177,7 @@ class QuickstartRenderer(SphinxRenderer):
else: else:
return False return False
def render(self, template_name: str, context: Dict) -> str: def render(self, template_name: str, context: Dict[str, Any]) -> str:
if self._has_custom_template(template_name): if self._has_custom_template(template_name):
custom_template = path.join(self.templatedir, path.basename(template_name)) custom_template = path.join(self.templatedir, path.basename(template_name))
return self.render_from_file(custom_template, context) return self.render_from_file(custom_template, context)