diff options
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 6 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 1f663b5..4c61abf 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1257,8 +1257,7 @@ class Backend: pdir = self.get_target_private_dir(target) i = i.replace('@PRIVATE_DIR@', pdir) else: - err_msg = f'Argument {i} is of unknown type {type(i)}' - raise RuntimeError(err_msg) + raise RuntimeError(f'Argument {i} is of unknown type {type(i)}') cmd.append(i) # Substitute the rest of the template strings values = mesonlib.get_filenames_templates_dict(inputs, outputs) @@ -1449,8 +1448,7 @@ class Backend: outdir = os.path.join(incroot, h.get_install_subdir()) for f in h.get_sources(): if not isinstance(f, File): - msg = f'Invalid header type {f!r} can\'t be installed' - raise MesonException(msg) + raise MesonException(f'Invalid header type {f!r} can\'t be installed') abspath = f.absolute_path(srcdir, builddir) i = InstallDataBase(abspath, outdir, h.get_custom_install_mode(), h.subproject) d.headers.append(i) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 33db672..db50f6a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -437,8 +437,7 @@ class NinjaBackend(backends.Backend): # 'benchmark', etc, and also for RunTargets. # https://github.com/mesonbuild/meson/issues/1644 if not to_target.startswith('meson-'): - m = f'Invalid usage of create_target_alias with {to_target!r}' - raise AssertionError(m) + raise AssertionError(f'Invalid usage of create_target_alias with {to_target!r}') from_target = to_target[len('meson-'):] elem = NinjaBuildElement(self.all_outputs, from_target, 'phony', to_target) self.add_build(elem) @@ -1390,8 +1389,7 @@ int dummy; # either in the source root, or generated with configure_file and # in the build root if not isinstance(s, File): - msg = f'All sources in target {t!r} must be of type mesonlib.File, not {s!r}' - raise InvalidArguments(msg) + raise InvalidArguments(f'All sources in target {t!r} must be of type mesonlib.File, not {s!r}') f = s.rel_to_builddir(self.build_to_src) if s.endswith(('.vala', '.gs')): srctype = vala @@ -1429,8 +1427,7 @@ int dummy; (vala_src, vapi_src, other_src) = self.split_vala_sources(target) extra_dep_files = [] if not vala_src: - msg = f'Vala library {target.name!r} has no Vala or Genie source files.' - raise InvalidArguments(msg) + raise InvalidArguments(f'Vala library {target.name!r} has no Vala or Genie source files.') valac = target.compilers['vala'] c_out_dir = self.get_target_private_dir(target) |