mirror of
https://github.com/tcsenpai/Zundler.git
synced 2025-06-07 03:55:26 +00:00
Improve version dependent code
This commit is contained in:
parent
430e342e2d
commit
b8753bb03c
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
from sphinx import version_info as sphinx_version_info
|
||||||
from sphinx.builders.html import StandaloneHTMLBuilder
|
from sphinx.builders.html import StandaloneHTMLBuilder
|
||||||
from sphinx.locale import get_translation
|
from sphinx.locale import get_translation
|
||||||
from sphinx.util import logging, progress_message
|
from sphinx.util import logging, progress_message
|
||||||
@ -16,10 +17,9 @@ class ZundlerBuilder(StandaloneHTMLBuilder):
|
|||||||
epilog = ""
|
epilog = ""
|
||||||
|
|
||||||
def __init__(self, app, env=None):
|
def __init__(self, app, env=None):
|
||||||
try:
|
if sphinx_version_info[0] >= 5:
|
||||||
super().__init__(app, env)
|
super().__init__(app, env)
|
||||||
except TypeError:
|
else:
|
||||||
# Sphinx<=4 expects only `app`
|
|
||||||
super().__init__(app)
|
super().__init__(app)
|
||||||
|
|
||||||
self.epilog = (
|
self.epilog = (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user