Skip to content

Commit

Permalink
🐛 Replace docutils private API use w/ public
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Nov 25, 2024
1 parent ffea355 commit 6c15158
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sphinx_autodoc_typehints/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from typing import TYPE_CHECKING, Any, AnyStr, ForwardRef, NewType, TypeVar, get_type_hints

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

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

Expand Down

0 comments on commit 6c15158

Please sign in to comment.