diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index 58c0a7835..a7853e92d 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -66,7 +66,7 @@ class CheckExternalLinksBuilder(DummyBuilder): output_text = path.join(self.outdir, 'output.txt') output_json = path.join(self.outdir, 'output.json') - with open(output_text, 'w', encoding='utf-8') as self.txt_outfile,\ + with open(output_text, 'w', encoding='utf-8') as self.txt_outfile, \ open(output_json, 'w', encoding='utf-8') as self.json_outfile: for result in checker.check(self.hyperlinks): self.process_result(result) diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py index 101635597..42e4e0352 100644 --- a/tests/test_build_linkcheck.py +++ b/tests/test_build_linkcheck.py @@ -782,7 +782,7 @@ def test_too_many_requests_retry_after_HTTP_date(app, capsys): @pytest.mark.sphinx('linkcheck', testroot='linkcheck-localserver', freshenv=True) def test_too_many_requests_retry_after_without_header(app, capsys): - with http_server(make_retry_after_handler([(429, None), (200, None)])),\ + with http_server(make_retry_after_handler([(429, None), (200, None)])), \ mock.patch("sphinx.builders.linkcheck.DEFAULT_DELAY", 0): app.build() content = (app.outdir / 'output.json').read_text(encoding='utf8')