bpo-31292: Fixed distutils check --restructuredtext for include directives (GH-10605)

This commit is contained in:
Philipp A 2019-03-27 22:34:19 +01:00 committed by Cheryl Sabella
parent a694f23948
commit d5a5a33f12
4 changed files with 20 additions and 2 deletions

View file

@ -120,7 +120,8 @@ class check(Command):
def _check_rst_data(self, data):
"""Returns warnings when the provided data doesn't compile."""
source_path = StringIO()
# 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()
settings.tab_width = 4