mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix mypy violations (with mypy-0.770)
This commit is contained in:
parent
4a1bf03233
commit
99476f37e7
2
setup.py
2
setup.py
@ -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',
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user