diff options
Diffstat (limited to 'sphinx/io.py')
-rw-r--r-- | sphinx/io.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sphinx/io.py b/sphinx/io.py index 33a2d8f19..5be98a385 100644 --- a/sphinx/io.py +++ b/sphinx/io.py @@ -3,6 +3,7 @@ import codecs import warnings from typing import TYPE_CHECKING, Any, List, Type +import docutils from docutils import nodes from docutils.core import Publisher from docutils.frontend import Values @@ -211,5 +212,8 @@ def create_publisher(app: "Sphinx", filetype: str) -> Publisher: # Propagate exceptions by default when used programmatically: defaults = {"traceback": True, **app.env.settings} # Set default settings - pub.settings = pub.setup_option_parser(**defaults).get_default_values() # type: ignore + if docutils.__version_info__[:2] >= (0, 19): + pub.get_settings(**defaults) # type: ignore[arg-type] + else: + pub.settings = pub.setup_option_parser(**defaults).get_default_values() # type: ignore return pub |