From 875a9b789f2f53fe0bd35d2bbe8277e8294e59f6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 20 Nov 2023 23:40:36 -0800 Subject: [PATCH] backend/ninja: remove duplicate isinstance() check --- mesonbuild/backend/ninjabackend.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index e808b0c92..4987d75a9 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -2782,10 +2782,11 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) rel_obj = os.path.join(self.get_target_private_dir(target), obj_basename) rel_obj += '.' + self.environment.machines[target.for_machine].get_object_suffix() commands += self.get_compile_debugfile_args(compiler, target, rel_obj) - if isinstance(src, File) and src.is_built: - rel_src = src.fname - elif isinstance(src, File): - rel_src = src.rel_to_builddir(self.build_to_src) + if isinstance(src, File): + if src.is_built: + rel_src = src.fname + else: + rel_src = src.rel_to_builddir(self.build_to_src) else: raise InvalidArguments(f'Invalid source type: {src!r}') # Write the Ninja build command