diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
commit | 6a0fabc6472f49621260de215f128a31ae70219b (patch) | |
tree | 6a67908358a2c5e5baa215fe0201dfe213dd8a01 /mesonbuild/scripts/depscan.py | |
parent | 4340bf34faca7eed8076ba4c388fbe15355f2183 (diff) | |
download | meson-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/depscan.py')
-rw-r--r-- | mesonbuild/scripts/depscan.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/scripts/depscan.py b/mesonbuild/scripts/depscan.py index 2879d8b..207bbc6 100644 --- a/mesonbuild/scripts/depscan.py +++ b/mesonbuild/scripts/depscan.py @@ -52,7 +52,7 @@ class DependencyScanner: elif suffix in lang_suffixes['cpp']: self.scan_cpp_file(fname) else: - sys.exit('Can not scan files with suffix .{}.'.format(suffix)) + sys.exit(f'Can not scan files with suffix .{suffix}.') def scan_fortran_file(self, fname: str) -> None: fpath = pathlib.Path(fname) @@ -75,7 +75,7 @@ class DependencyScanner: assert(exported_module not in modules_in_this_file) modules_in_this_file.add(exported_module) if exported_module in self.provided_by: - raise RuntimeError('Multiple files provide module {}.'.format(exported_module)) + raise RuntimeError(f'Multiple files provide module {exported_module}.') self.sources_with_exports.append(fname) self.provided_by[exported_module] = fname self.exports[fname] = exported_module @@ -89,7 +89,7 @@ class DependencyScanner: parent_module_name_full = submodule_export_match.group(1).lower() parent_module_name = parent_module_name_full.split(':')[0] submodule_name = submodule_export_match.group(2).lower() - concat_name = '{}:{}'.format(parent_module_name, submodule_name) + concat_name = f'{parent_module_name}:{submodule_name}' self.sources_with_exports.append(fname) self.provided_by[concat_name] = fname self.exports[fname] = concat_name @@ -120,7 +120,7 @@ class DependencyScanner: if export_match: exported_module = export_match.group(1) if exported_module in self.provided_by: - raise RuntimeError('Multiple files provide module {}.'.format(exported_module)) + raise RuntimeError(f'Multiple files provide module {exported_module}.') self.sources_with_exports.append(fname) self.provided_by[exported_module] = fname self.exports[fname] = exported_module @@ -141,7 +141,7 @@ class DependencyScanner: extension = 'smod' else: extension = 'mod' - return os.path.join(self.target_data.private_dir, '{}.{}'.format(namebase, extension)) + return os.path.join(self.target_data.private_dir, f'{namebase}.{extension}') elif suffix in lang_suffixes['cpp']: return '{}.ifc'.format(self.exports[src]) else: |