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' name = 'zundler'
epilog = "" epilog = ""
def __init__(self, app, env): def __init__(self, app, env=None):
super().__init__(app, env) try:
super().__init__(app, env)
except TypeError:
# Sphinx<=4 expects only `app`
super().__init__(app)
self.epilog = ( self.epilog = (
'Your self-contained HTML file is now in %s.' % 'Your self-contained HTML file is now in %s.' %
relpath(self.app.original_outdir) relpath(self.app.original_outdir)