Skip to content

Commit

Permalink
Merge pull request #9983 from tk0miya/mypy-0.920
Browse files Browse the repository at this point in the history
Fix mypy violations (with mypy-0.920)
  • Loading branch information
tk0miya authored Dec 16, 2021
2 parents 3ae124f + 95d6478 commit 54613e0
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
'lint': [
'flake8>=3.5.0',
'isort',
'mypy>=0.900',
'mypy>=0.920',
'docutils-stubs',
"types-typed-ast",
"types-pkg_resources",
Expand Down
2 changes: 1 addition & 1 deletion sphinx/builders/gettext.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def write_doc(self, docname: str, doctree: nodes.document) -> None:

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

def utcoffset(self, dt: datetime) -> timedelta:
Expand Down
4 changes: 2 additions & 2 deletions sphinx/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def md5(data=b'', **kwargs):
"""

try:
return hashlib.md5(data, **kwargs) # type: ignore
return hashlib.md5(data, **kwargs)
except ValueError:
return hashlib.md5(data, **kwargs, usedforsecurity=False) # type: ignore

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

try:
return hashlib.sha1(data, **kwargs) # type: ignore
return hashlib.sha1(data, **kwargs)
except ValueError:
return hashlib.sha1(data, **kwargs, usedforsecurity=False) # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def is_singledispatch_function(obj: Any) -> bool:
if (inspect.isfunction(obj) and
hasattr(obj, 'dispatch') and
hasattr(obj, 'register') and
obj.dispatch.__module__ == 'functools'):
obj.dispatch.__module__ == 'functools'): # type: ignore
return True
else:
return False
Expand Down
2 changes: 1 addition & 1 deletion sphinx/util/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class SphinxLoggerAdapter(logging.LoggerAdapter):
"""LoggerAdapter allowing ``type`` and ``subtype`` keywords."""
KEYWORDS = ['type', 'subtype', 'location', 'nonl', 'color', 'once']

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

0 comments on commit 54613e0

Please sign in to comment.