Don't return False always on __exit__()

According to the python/mypy#7214, mypy-0.740 prefers a return
value of __exit__() method which does not swallow exceptions is
None instead of bool.

mypy#7214: https://github.com/python/mypy/issues/7214
This commit is contained in:
Takeshi KOMIYA
2019-10-20 18:54:41 +09:00
parent f30e2af762
commit ee45bb310b

View File

@@ -187,9 +187,8 @@ class sphinx_domains:
def __enter__(self) -> None:
self.enable()
def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> bool: # type: ignore # NOQA
def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> None: # NOQA
self.disable()
return False
def enable(self) -> None:
self.directive_func = directives.directive