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 <>
Reviewed-by: default avatarIustin Pop <>
parent b497a636
......@@ -197,7 +197,11 @@ class PythonAssert(sphinx.util.compat.Directive):
final_argument_whitespace = False
def run(self):
# Handle combinations of Sphinx and docutils not providing the wanted method
if hasattr(self, "assert_has_content"):
assert 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