Compatibility for Sphinx<=4 and Sphinx>4

This commit is contained in:
Adrian Vollmer 2022-10-09 18:07:01 +02:00
parent 996adba3a0
commit 4088f251e3

View File

@ -15,8 +15,13 @@ class ZundlerBuilder(StandaloneHTMLBuilder):
name = 'zundler'
epilog = ""
def __init__(self, app, env):
super().__init__(app, env)
def __init__(self, app, env=None):
try:
super().__init__(app, env)
except TypeError:
# Sphinx<=4 expects only `app`
super().__init__(app)
self.epilog = (
'Your self-contained HTML file is now in %s.' %
relpath(self.app.original_outdir)