From ee45bb310bd76b5565af7092cfda279f92e19e9a Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 20 Oct 2019 18:54:41 +0900 Subject: [PATCH] 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 --- sphinx/util/docutils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py index e455d0aad..233c1a2aa 100644 --- a/sphinx/util/docutils.py +++ b/sphinx/util/docutils.py @@ -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