diff options
author | Eli Schwartz <eschwartz93@gmail.com> | 2023-12-11 01:22:15 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-02-12 18:52:43 -0500 |
commit | 07c051ed27059f16edae803b9197871225d71193 (patch) | |
tree | fe802f2dce813072b0d3405fc54339e6e934ab7f /mesonbuild/wrap | |
parent | dabe7b16d9b2bbb67c93be27723e68978ae80e3b (diff) | |
download | meson-07c051ed27059f16edae803b9197871225d71193.zip meson-07c051ed27059f16edae803b9197871225d71193.tar.gz meson-07c051ed27059f16edae803b9197871225d71193.tar.bz2 |
defer setting values until after we know it cannot be None
Diffstat (limited to 'mesonbuild/wrap')
-rw-r--r-- | mesonbuild/wrap/wrap.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 53caa02..c355c6d 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -404,12 +404,13 @@ class Resolver: def resolve(self, packagename: str, force_method: T.Optional[Method] = None) -> T.Tuple[str, Method]: self.packagename = packagename self.directory = packagename - self.wrap = self.wraps.get(packagename) - if not self.wrap: - self.wrap = self.get_from_wrapdb(packagename) - if not self.wrap: + wrap = self.wraps.get(packagename) + if not wrap: + wrap = self.get_from_wrapdb(packagename) + if not wrap: m = f'Neither a subproject directory nor a {self.packagename}.wrap file was found.' raise WrapNotFoundException(m) + self.wrap = wrap self.directory = self.wrap.directory if self.wrap.has_wrap: |