diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-03 20:01:40 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-04 16:29:31 -0400 |
commit | 47ae0b82f0483960fa7a3eabc68700b982688834 (patch) | |
tree | 3f42f75807e35ad88e5453a0b247b8315f25ef84 /mesonbuild | |
parent | 4ab70c5512f147c7dded62817e54724830740dfd (diff) | |
download | meson-47ae0b82f0483960fa7a3eabc68700b982688834.zip meson-47ae0b82f0483960fa7a3eabc68700b982688834.tar.gz meson-47ae0b82f0483960fa7a3eabc68700b982688834.tar.bz2 |
use list unpacking to simplify for loop references
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/mintro.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index ab668d5..c664abd 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -492,14 +492,15 @@ updated_introspection_files = [] # type: T.List[str] def write_intro_info(intro_info: T.Sequence[T.Tuple[str, T.Union[dict, T.List[T.Any]]]], info_dir: str) -> None: global updated_introspection_files - for i in intro_info: - out_file = os.path.join(info_dir, 'intro-{}.json'.format(i[0])) + for kind, data in intro_info: + print(f'processing {kind}, {data}') + out_file = os.path.join(info_dir, f'intro-{kind}.json') tmp_file = os.path.join(info_dir, 'tmp_dump.json') with open(tmp_file, 'w', encoding='utf-8') as fp: - json.dump(i[1], fp) + json.dump(data, fp) fp.flush() # Not sure if this is needed os.replace(tmp_file, out_file) - updated_introspection_files += [i[0]] + updated_introspection_files += [kind] def generate_introspection_file(builddata: build.Build, backend: backends.Backend) -> None: coredata = builddata.environment.get_coredata() |