From: Serhiy Storchaka Date: Mon, 12 Feb 2024 11:45:22 +0000 (+0200) Subject: [3.11] gh-115198: Fix support of Docutils >= 0.19 in distutils (GH-115220) X-Git-Tag: v3.11.9~224 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f938c1104a0482d9043e60b388eeac7f2b47026;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-115198: Fix support of Docutils >= 0.19 in distutils (GH-115220) --- diff --git a/Lib/distutils/command/check.py b/Lib/distutils/command/check.py index 73a30f3afd84..0a5976676a81 100644 --- a/Lib/distutils/command/check.py +++ b/Lib/distutils/command/check.py @@ -125,7 +125,13 @@ class check(Command): # 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 diff --git a/Misc/NEWS.d/next/Library/2024-02-09-17-56-06.gh-issue-115198.QKrxUQ.rst b/Misc/NEWS.d/next/Library/2024-02-09-17-56-06.gh-issue-115198.QKrxUQ.rst new file mode 100644 index 000000000000..78c10aeb4f9e --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-02-09-17-56-06.gh-issue-115198.QKrxUQ.rst @@ -0,0 +1 @@ +Fix support of Docutils >= 0.19 in :mod:`distutils`.