From 6058d70ee152122733dafd5a91f8362331ba59f4 Mon Sep 17 00:00:00 2001 From: MomIsBestFriend <> Date: Tue, 3 Dec 2019 06:42:44 +0200 Subject: [PATCH] F-strings --- ci/print_skipped.py | 5 ++--- doc/sphinxext/announce.py | 12 ++++++------ doc/sphinxext/contributors.py | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ci/print_skipped.py b/ci/print_skipped.py index 51a2460e05fab..2b5cf1ab34295 100755 --- a/ci/print_skipped.py +++ b/ci/print_skipped.py @@ -32,8 +32,7 @@ def main(filename): print("-" * 80) else: print( - "#{i} {class_name}.{test_name}: {message}".format( - **dict(test_data, i=i) - ) + f"#{i} {test_data['class_name']}." + f"{test_data['test_name']}: {test_data['message']}" ) i += 1 diff --git a/doc/sphinxext/announce.py b/doc/sphinxext/announce.py index 1a5ab99b5a94f..fdc5a6b283ba8 100755 --- a/doc/sphinxext/announce.py +++ b/doc/sphinxext/announce.py @@ -113,13 +113,13 @@ def build_string(revision_range, heading="Contributors"): components["authors"] = "* " + "\n* ".join(components["authors"]) tpl = textwrap.dedent( - """\ - {heading} - {uline} + f"""\ + {components['heading']} + {components['uline']} - {author_message} - {authors}""" - ).format(**components) + {components['author_message']} + {components['authors']}""" + ) return tpl diff --git a/doc/sphinxext/contributors.py b/doc/sphinxext/contributors.py index 1a064f71792e9..d9ba2bb2cfb07 100644 --- a/doc/sphinxext/contributors.py +++ b/doc/sphinxext/contributors.py @@ -27,7 +27,7 @@ def run(self): except git.GitCommandError as exc: return [ self.state.document.reporter.warning( - "Cannot find contributors for range '{}': {}".format(range_, exc), + f"Cannot find contributors for range {repr(range_)}: {exc}", line=self.lineno, ) ]