From 79a841e98ce9be336e1faf115dcf10276bc8bf98 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Thu, 20 Apr 2017 00:03:54 +0200 Subject: [PATCH] Remove misplaced flags from re.sub() calls The 4th argument of re.sub() is maximum number of substitutions, not flags. Moreover, re.MULTILINE affects only semantics of ^ and $, so it wouldn't have any effect on this regular expression. --- tests/test_build_html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_build_html.py b/tests/test_build_html.py index 4605629f7..ad4c29dcb 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -587,7 +587,7 @@ def test_numfig_without_numbered_toctree_warn(app, warning): app.build() # remove :numbered: option index = (app.srcdir / 'index.rst').text() - index = re.sub(':numbered:.*', '', index, re.MULTILINE) + index = re.sub(':numbered:.*', '', index) (app.srcdir / 'index.rst').write_text(index, encoding='utf-8') app.builder.build_all() @@ -685,7 +685,7 @@ def test_numfig_without_numbered_toctree_warn(app, warning): def test_numfig_without_numbered_toctree(app, cached_etree_parse, fname, expect): # remove :numbered: option index = (app.srcdir / 'index.rst').text() - index = re.sub(':numbered:.*', '', index, re.MULTILINE) + index = re.sub(':numbered:.*', '', index) (app.srcdir / 'index.rst').write_text(index, encoding='utf-8') if not app.outdir.listdir():