From 6a0fabc6472f49621260de215f128a31ae70219b Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 4 Mar 2021 17:16:11 -0500 Subject: mass rewrite of string formatting to use f-strings everywhere performed by running "pyupgrade --py36-plus" and committing the results --- mesonbuild/scripts/externalproject.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mesonbuild/scripts/externalproject.py') diff --git a/mesonbuild/scripts/externalproject.py b/mesonbuild/scripts/externalproject.py index a3ffe73..657ef2f 100644 --- a/mesonbuild/scripts/externalproject.py +++ b/mesonbuild/scripts/externalproject.py @@ -35,7 +35,7 @@ class ExternalProject: def write_depfile(self) -> None: with open(self.depfile, 'w') as f: - f.write('{}: \\\n'.format(self.stampfile)) + f.write(f'{self.stampfile}: \\\n') for dirpath, dirnames, filenames in os.walk(self.src_dir): dirnames[:] = [d for d in dirnames if not d.startswith('.')] for fname in filenames: @@ -75,7 +75,7 @@ class ExternalProject: def _run(self, step: str, command: T.List[str]) -> int: m = 'Running command ' + str(command) + ' in directory ' + str(self.build_dir) + '\n' - log_filename = Path(self.log_dir, '{}-{}.log'.format(self.name, step)) + log_filename = Path(self.log_dir, f'{self.name}-{step}.log') output = None if not self.verbose: output = open(log_filename, 'w') @@ -86,7 +86,7 @@ class ExternalProject: p, o, e = Popen_safe(command, stderr=subprocess.STDOUT, stdout=output, cwd=self.build_dir) if p.returncode != 0: - m = '{} step returned error code {}.'.format(step, p.returncode) + m = f'{step} step returned error code {p.returncode}.' if not self.verbose: m += '\nSee logs: ' + str(log_filename) print(m) -- cgit v1.1