Skip to content

Commit 2bca018

Browse files
Fix GH #54853: BUG: DeprecationWarning for frontend.OptionParser when building docs (#54854)
* Fix GH #54853: BUG: DeprecationWarning for frontend.OptionParser when building docs See docutils/docutils@6548b56#diff-a033583f6ace19fed2adc108b1c130e17ea00e1afee38c22c993cb477ad27a5fR453 * Use `docutils.frontend.get_default_settings` instead of relying on `docutils.core`. --------- Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
1 parent 609c3b7 commit 2bca018

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/make.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ def _get_page_title(self, page):
159159
Open the rst file `page` and extract its title.
160160
"""
161161
fname = os.path.join(SOURCE_PATH, f"{page}.rst")
162-
option_parser = docutils.frontend.OptionParser(
163-
components=(docutils.parsers.rst.Parser,)
162+
doc = docutils.utils.new_document(
163+
"<doc>",
164+
docutils.frontend.get_default_settings(docutils.parsers.rst.Parser),
164165
)
165-
doc = docutils.utils.new_document("<doc>", option_parser.get_default_values())
166166
with open(fname, encoding="utf-8") as f:
167167
data = f.read()
168168

0 commit comments

Comments
 (0)