Skip to content

[3.11] gh-115198: Fix support of Docutils >= 0.19 in distutils #115220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Lib/distutils/command/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ def _check_rst_data(self, data):
# the include and csv_table directives need this to be a path
source_path = self.distribution.script_name or 'setup.py'
parser = Parser()
settings = frontend.OptionParser(components=(Parser,)).get_default_values()
try:
get_default_settings = frontend.get_default_settings
except AttributeError:
# Deprecated in Docutils 0.19, may be broken in Docutils 0.21.
settings = frontend.OptionParser(components=(Parser,)).get_default_values()
else:
settings = get_default_settings(Parser)
settings.tab_width = 4
settings.pep_references = None
settings.rfc_references = None
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix support of Docutils >= 0.19 in :mod:`distutils`.