Skip to content

Commit 95d6478

Browse files
committed
Fix mypy violations (with mypy-0.920)
1 parent 3ae124f commit 95d6478

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'lint': [
4545
'flake8>=3.5.0',
4646
'isort',
47-
'mypy>=0.900',
47+
'mypy>=0.920',
4848
'docutils-stubs',
4949
"types-typed-ast",
5050
"types-pkg_resources",

sphinx/builders/gettext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def write_doc(self, docname: str, doctree: nodes.document) -> None:
180180

181181
class LocalTimeZone(tzinfo):
182182
def __init__(self, *args: Any, **kwargs: Any) -> None:
183-
super().__init__(*args, **kwargs) # type: ignore
183+
super().__init__(*args, **kwargs)
184184
self.tzdelta = tzdelta
185185

186186
def utcoffset(self, dt: datetime) -> timedelta:

sphinx/util/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def md5(data=b'', **kwargs):
153153
"""
154154

155155
try:
156-
return hashlib.md5(data, **kwargs) # type: ignore
156+
return hashlib.md5(data, **kwargs)
157157
except ValueError:
158158
return hashlib.md5(data, **kwargs, usedforsecurity=False) # type: ignore
159159

@@ -167,7 +167,7 @@ def sha1(data=b'', **kwargs):
167167
"""
168168

169169
try:
170-
return hashlib.sha1(data, **kwargs) # type: ignore
170+
return hashlib.sha1(data, **kwargs)
171171
except ValueError:
172172
return hashlib.sha1(data, **kwargs, usedforsecurity=False) # type: ignore
173173

sphinx/util/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def is_singledispatch_function(obj: Any) -> bool:
355355
if (inspect.isfunction(obj) and
356356
hasattr(obj, 'dispatch') and
357357
hasattr(obj, 'register') and
358-
obj.dispatch.__module__ == 'functools'):
358+
obj.dispatch.__module__ == 'functools'): # type: ignore
359359
return True
360360
else:
361361
return False

sphinx/util/logging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class SphinxLoggerAdapter(logging.LoggerAdapter):
118118
"""LoggerAdapter allowing ``type`` and ``subtype`` keywords."""
119119
KEYWORDS = ['type', 'subtype', 'location', 'nonl', 'color', 'once']
120120

121-
def log(self, level: Union[int, str], msg: str, *args: Any, **kwargs: Any) -> None:
121+
def log(self, level: Union[int, str], msg: str, *args: Any, **kwargs: Any) -> None: # type: ignore # NOQA
122122
if isinstance(level, int):
123123
super().log(level, msg, *args, **kwargs)
124124
else:

0 commit comments

Comments
 (0)