aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/externalproject.py
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:16:11 -0500
committerEli Schwartz <eschwartz@archlinux.org>2021-03-04 17:16:11 -0500
commit6a0fabc6472f49621260de215f128a31ae70219b (patch)
tree6a67908358a2c5e5baa215fe0201dfe213dd8a01 /mesonbuild/scripts/externalproject.py
parent4340bf34faca7eed8076ba4c388fbe15355f2183 (diff)
downloadmeson-6a0fabc6472f49621260de215f128a31ae70219b.zip
meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.gz
meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.bz2
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
Diffstat (limited to 'mesonbuild/scripts/externalproject.py')
-rw-r--r--mesonbuild/scripts/externalproject.py6
1 files changed, 3 insertions, 3 deletions
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)