From d661a0cd96e2453e8e4629c867589657b81239d1 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 27 Jul 2021 15:26:02 -0700 Subject: build: use an object rather than a dict for the dep_manifest This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string. --- mesonbuild/backend/backends.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mesonbuild/backend') diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 4570b00..bc2b74a 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1144,7 +1144,8 @@ class Backend: ifilename = os.path.join(self.environment.get_build_dir(), 'depmf.json') ofilename = os.path.join(self.environment.get_prefix(), self.build.dep_manifest_name) out_name = os.path.join('{prefix}', self.build.dep_manifest_name) - mfobj = {'type': 'dependency manifest', 'version': '1.0', 'projects': self.build.dep_manifest} + mfobj = {'type': 'dependency manifest', 'version': '1.0', + 'projects': {k: v.to_json() for k, v in self.build.dep_manifest.items()}} with open(ifilename, 'w', encoding='utf-8') as f: f.write(json.dumps(mfobj)) # Copy file from, to, and with mode unchanged -- cgit v1.1