Commit cbb86b63 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix build error when using docutils 0.4



Docutils 0.4 doesn't provide the “Directive” class and Sphinx supplies
its own version which doesn't have the “assert_has_content” method.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b497a636
...@@ -197,7 +197,11 @@ class PythonAssert(sphinx.util.compat.Directive): ...@@ -197,7 +197,11 @@ class PythonAssert(sphinx.util.compat.Directive):
final_argument_whitespace = False final_argument_whitespace = False
def run(self): def run(self):
self.assert_has_content() # Handle combinations of Sphinx and docutils not providing the wanted method
if hasattr(self, "assert_has_content"):
self.assert_has_content()
else:
assert self.content
code = "\n".join(self.content) code = "\n".join(self.content)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment