Merge pull request #10065 from tk0miya/mypy-0.931

Fix mypy violations (with mypy-0.931)
This commit is contained in:
Takeshi KOMIYA
2022-01-09 01:07:56 +09:00
committed by GitHub
3 changed files with 6 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ extras_require = {
'lint': [
'flake8>=3.5.0',
'isort',
'mypy>=0.930',
'mypy>=0.931',
'docutils-stubs',
"types-typed-ast",
"types-pkg_resources",

View File

@@ -9,7 +9,7 @@
import os
import warnings
from os import path
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, cast
from typing import TYPE_CHECKING, Any, Dict, List, Sequence, Tuple, cast
from docutils import nodes
from docutils.nodes import Node, make_id, system_message
@@ -71,7 +71,7 @@ class Figure(images.Figure):
class Meta(MetaBase, SphinxDirective):
def run(self) -> List[Node]:
def run(self) -> Sequence[Node]:
result = super().run()
for node in result:
if (isinstance(node, nodes.pending) and

View File

@@ -25,17 +25,17 @@ try:
except ImportError:
# python-requests package in Debian jessie does not provide ``requests.packages.urllib3``.
# So try to import the exceptions from urllib3 package.
from urllib3.exceptions import SSLError # type: ignore
from urllib3.exceptions import SSLError
try:
from requests.packages.urllib3.exceptions import InsecureRequestWarning
except ImportError:
try:
# for Debian-jessie
from urllib3.exceptions import InsecureRequestWarning # type: ignore
from urllib3.exceptions import InsecureRequestWarning
except ImportError:
# for requests < 2.4.0
InsecureRequestWarning = None # type: ignore
InsecureRequestWarning = None
useragent_header = [('User-Agent',