Skip to content

Commit 6fb5f06

Browse files
authored
🐛 Replace docutils private API use w/ public (#507)
Fixes #454 Ref https://sourceforge.net/p/docutils/bugs/496.
1 parent ffea355 commit 6fb5f06

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sphinx_autodoc_typehints/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from typing import TYPE_CHECKING, Any, AnyStr, ForwardRef, NewType, TypeVar, get_type_hints
1414

1515
from docutils import nodes
16-
from docutils.frontend import OptionParser
16+
from docutils.frontend import get_default_settings
1717
from sphinx.ext.autodoc.mock import mock
1818
from sphinx.parsers import RSTParser
1919
from sphinx.util import logging, rst
@@ -849,7 +849,7 @@ def get_insert_index(app: Sphinx, lines: list[str]) -> InsertIndexInfo | None:
849849

850850
# 3. Insert after the parameters.
851851
# To find the parameters, parse as a docutils tree.
852-
settings = OptionParser(components=(RSTParser,)).get_default_values()
852+
settings = get_default_settings(RSTParser)
853853
settings.env = app.env
854854
doc = parse("\n".join(lines), settings)
855855

0 commit comments

Comments
 (0)