From 6c151583fb898731ebdb10bd6c36c2731fdd6180 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 25 Nov 2024 16:00:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Replace=20docutils=20private=20A?= =?UTF-8?q?PI=20use=20w/=20public?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #454 Ref https://sourceforge.net/p/docutils/bugs/496. --- src/sphinx_autodoc_typehints/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sphinx_autodoc_typehints/__init__.py b/src/sphinx_autodoc_typehints/__init__.py index e67180f..ce41602 100644 --- a/src/sphinx_autodoc_typehints/__init__.py +++ b/src/sphinx_autodoc_typehints/__init__.py @@ -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 @@ -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)