diff options
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 14 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 10 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/xcodebackend.py | 32 |
4 files changed, 29 insertions, 29 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index d71cae3..b119377 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -179,7 +179,7 @@ class ExecutableSerialisation: self.cmd_args = cmd_args self.env = env if exe_wrapper is not None: - assert(isinstance(exe_wrapper, programs.ExternalProgram)) + assert isinstance(exe_wrapper, programs.ExternalProgram) self.exe_runner = exe_wrapper self.workdir = workdir self.extra_paths = extra_paths @@ -205,7 +205,7 @@ class TestSerialisation: self.fname = fname self.is_cross_built = is_cross_built if exe_wrapper is not None: - assert(isinstance(exe_wrapper, programs.ExternalProgram)) + assert isinstance(exe_wrapper, programs.ExternalProgram) self.exe_runner = exe_wrapper self.is_parallel = is_parallel self.cmd_args = cmd_args @@ -288,7 +288,7 @@ class Backend: elif isinstance(t, build.CustomTargetIndex): filename = t.get_outputs()[0] else: - assert(isinstance(t, build.BuildTarget)) + assert isinstance(t, build.BuildTarget) filename = t.get_filename() return os.path.join(self.get_target_dir(t), filename) @@ -985,7 +985,7 @@ class Backend: def build_target_link_arguments(self, compiler: 'Compiler', deps: T.List[build.Target]) -> T.List[str]: args: T.List[str] = [] for d in deps: - if not (d.is_linkable_target()): + if not d.is_linkable_target(): raise RuntimeError(f'Tried to link with a non-library target "{d.get_basename()}".') arg = self.get_target_filename_for_linking(d) if not arg: @@ -1127,7 +1127,7 @@ class Backend: def construct_target_rel_path(self, a: build.Target, workdir: T.Optional[str]) -> str: if workdir is None: return self.get_target_filename(a) - assert(os.path.isabs(workdir)) + assert os.path.isabs(workdir) abs_path = self.get_target_filename_abs(a) return os.path.relpath(abs_path, workdir) @@ -1653,12 +1653,12 @@ class Backend: srcdir = self.environment.get_source_dir() builddir = self.environment.get_build_dir() for de in data: - assert(isinstance(de, build.Data)) + assert isinstance(de, build.Data) subdir = de.install_dir if not subdir: subdir = os.path.join(self.environment.get_datadir(), self.interpreter.build.project_name) for src_file, dst_name in zip(de.sources, de.rename): - assert(isinstance(src_file, mesonlib.File)) + assert isinstance(src_file, mesonlib.File) dst_abs = os.path.join(subdir, dst_name) tag = de.install_tag or self.guess_install_tag(dst_abs) i = InstallDataBase(src_file.absolute_path(srcdir, builddir), dst_abs, de.install_mode, de.subproject, tag=tag) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index dc5b5df..ca9ab9a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -252,7 +252,7 @@ class NinjaRule: outfile.write(' rspfile = $out.rsp\n') outfile.write(' rspfile_content = {}\n'.format(' '.join([self._quoter(x, rspfile_quote_func) for x in self.args]))) else: - outfile.write(' command = {}\n'.format(' '.join([self._quoter(x) for x in (self.command + self.args)]))) + outfile.write(' command = {}\n'.format(' '.join([self._quoter(x) for x in self.command + self.args]))) if self.deps: outfile.write(f' deps = {self.deps}\n') if self.depfile: @@ -302,7 +302,7 @@ class NinjaBuildElement: self.outfilenames = [outfilenames] else: self.outfilenames = outfilenames - assert(isinstance(rulename, str)) + assert isinstance(rulename, str) self.rulename = rulename if isinstance(infilenames, str): self.infilenames = [infilenames] @@ -2619,8 +2619,8 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) self.add_dependency_scanner_entries_to_element(target, compiler, element, src) self.add_build(element) - assert(isinstance(rel_obj, str)) - assert(isinstance(rel_src, str)) + assert isinstance(rel_obj, str) + assert isinstance(rel_src, str) return (rel_obj, rel_src.replace('\\', '/')) def add_dependency_scanner_entries_to_element(self, target, compiler, element, src): @@ -2903,7 +2903,7 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) return guessed_dependencies + absolute_libs def generate_prelink(self, target, obj_list): - assert(isinstance(target, build.StaticLibrary)) + assert isinstance(target, build.StaticLibrary) prelink_name = os.path.join(self.get_target_private_dir(target), target.name + '-prelink.o') elem = NinjaBuildElement(self.all_outputs, [prelink_name], 'CUSTOM_COMMAND', obj_list) diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 0a6e7cd..0cf0b72 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -1228,7 +1228,7 @@ class Vs2010Backend(backends.Backend): additional_links.append(self.relpath(lib, self.get_target_dir(target))) additional_objects = [] for o in self.flatten_object_list(target, down): - assert(isinstance(o, str)) + assert isinstance(o, str) additional_objects.append(o) for o in custom_objs: additional_objects.append(o) diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index b1a8956..1139f79 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -104,8 +104,8 @@ class PbxArrayItem: class PbxComment: def __init__(self, text): - assert(isinstance(text, str)) - assert('/*' not in text) + assert isinstance(text, str) + assert '/*' not in text self.text = f'/* {text} */' def write(self, ofile, indent_level): @@ -132,7 +132,7 @@ class PbxDict: def add_item(self, key, value, comment=''): item = PbxDictItem(key, value, comment) - assert(key not in self.keys) + assert key not in self.keys self.keys.add(key) self.items.append(item) @@ -143,7 +143,7 @@ class PbxDict: if isinstance(comment, str): self.items.append(PbxComment(str)) else: - assert(isinstance(comment, PbxComment)) + assert isinstance(comment, PbxComment) self.items.append(comment) def write(self, ofile, indent_level): @@ -434,14 +434,14 @@ class XCodeBackend(backends.Backend): def gen_single_target_map(self, genlist, tname, t, generator_id): k = (tname, generator_id) - assert(k not in self.shell_targets) + assert k not in self.shell_targets self.shell_targets[k] = self.gen_id() ofile_abs = [] for i in genlist.get_inputs(): for o_base in genlist.get_outputs_for(i): o = os.path.join(self.get_target_private_dir(t), o_base) ofile_abs.append(os.path.join(self.environment.get_build_dir(), o)) - assert(k not in self.generator_outputs) + assert k not in self.generator_outputs self.generator_outputs[k] = ofile_abs buildfile_ids = [] fileref_ids = [] @@ -472,11 +472,11 @@ class XCodeBackend(backends.Backend): continue else: k = (tname, target.get_basename()) - assert(k not in self.target_dependency_map) + assert k not in self.target_dependency_map self.target_dependency_map[k] = self.gen_id() for tname, t in self.custom_targets.items(): k = tname - assert(k not in self.target_dependency_map) + assert k not in self.target_dependency_map self.target_dependency_map[k] = self.gen_id() def generate_pbxdep_map(self): @@ -504,9 +504,9 @@ class XCodeBackend(backends.Backend): if not isinstance(s, str): continue k = (tname, s) - assert(k not in self.buildfile_ids) + assert k not in self.buildfile_ids self.buildfile_ids[k] = self.gen_id() - assert(k not in self.fileref_ids) + assert k not in self.fileref_ids self.fileref_ids[k] = self.gen_id() if not hasattr(t, 'objects'): continue @@ -519,16 +519,16 @@ class XCodeBackend(backends.Backend): if isinstance(o, str): o = os.path.join(t.subdir, o) k = (tname, o) - assert(k not in self.buildfile_ids) + assert k not in self.buildfile_ids self.buildfile_ids[k] = self.gen_id() - assert(k not in self.fileref_ids) + assert k not in self.fileref_ids self.fileref_ids[k] = self.gen_id() else: raise RuntimeError('Unknown input type ' + str(o)) def generate_build_file_maps(self): for buildfile in self.interpreter.get_build_def_files(): - assert(isinstance(buildfile, str)) + assert isinstance(buildfile, str) self.buildfile_ids[buildfile] = self.gen_id() self.fileref_ids[buildfile] = self.gen_id() @@ -641,7 +641,7 @@ class XCodeBackend(backends.Backend): idval = self.buildfile_ids[(tname, o)] k = (tname, o) fileref = self.fileref_ids[k] - assert(o not in self.filemap) + assert o not in self.filemap self.filemap[o] = idval fullpath = os.path.join(self.environment.get_source_dir(), o) fullpath2 = fullpath @@ -677,7 +677,7 @@ class XCodeBackend(backends.Backend): def create_generator_shellphase(self, objects_dict, tname, generator_id): file_ids = self.generator_buildfile_ids[(tname, generator_id)] ref_ids = self.generator_fileref_ids[(tname, generator_id)] - assert(len(ref_ids) == len(file_ids)) + assert len(ref_ids) == len(file_ids) for i in range(len(file_ids)): file_o = file_ids[i] ref_id = ref_ids[i] @@ -757,7 +757,7 @@ class XCodeBackend(backends.Backend): continue outputs = self.generator_outputs[(tname, generator_id)] ref_ids = self.generator_fileref_ids[tname, generator_id] - assert(len(ref_ids) == len(outputs)) + assert len(ref_ids) == len(outputs) for i in range(len(outputs)): o = outputs[i] ref_id = ref_ids[i] |