Fix mypy violations (with mypy-0.770)

This commit is contained in:
Takeshi KOMIYA 2020-03-12 01:25:18 +09:00
parent 4a1bf03233
commit 99476f37e7
4 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ extras_require = {
'html5lib', 'html5lib',
'flake8>=3.5.0', 'flake8>=3.5.0',
'flake8-import-order', 'flake8-import-order',
'mypy>=0.761', 'mypy>=0.770',
'docutils-stubs', 'docutils-stubs',
], ],
} }

View File

@ -497,7 +497,7 @@ class Sphinx:
other values. other values.
""" """
logger.debug('[app] adding config value: %r', logger.debug('[app] adding config value: %r',
(name, default, rebuild) + ((types,) if types else ())) # type: ignore (name, default, rebuild) + ((types,) if types else ()))
if rebuild in (False, True): if rebuild in (False, True):
rebuild = 'env' if rebuild else '' rebuild = 'env' if rebuild else ''
self.config.add(name, default, rebuild, types) self.config.add(name, default, rebuild, types)

View File

@ -35,7 +35,7 @@ def get_terminal_width() -> int:
import termios import termios
import fcntl import fcntl
import struct import struct
call = fcntl.ioctl(0, termios.TIOCGWINSZ, call = fcntl.ioctl(0, termios.TIOCGWINSZ, # type: ignore
struct.pack('hhhh', 0, 0, 0, 0)) struct.pack('hhhh', 0, 0, 0, 0))
height, width = struct.unpack('hhhh', call)[:2] height, width = struct.unpack('hhhh', call)[:2]
terminal_width = width terminal_width = width

View File

@ -199,7 +199,7 @@ def is_translatable(node: Node) -> bool:
if isinstance(node, addnodes.translatable): if isinstance(node, addnodes.translatable):
return True return True
if isinstance(node, nodes.Inline) and 'translatable' not in node: if isinstance(node, nodes.Inline) and 'translatable' not in node: # type: ignore
# inline node must not be translated if 'translatable' is not set # inline node must not be translated if 'translatable' is not set
return False return False