aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2016-11-04 13:18:30 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2016-11-04 14:21:52 +0530
commit268f73761205c55219b96e41debd2120a29b3c43 (patch)
treed3102ee5ac5a850207a60a3a02ab1a9be5afe49d
parent314eb5110e14a71939f1535f4271461d9c439b50 (diff)
downloadmeson-268f73761205c55219b96e41debd2120a29b3c43.zip
meson-268f73761205c55219b96e41debd2120a29b3c43.tar.gz
meson-268f73761205c55219b96e41debd2120a29b3c43.tar.bz2
dependency: Check that cached_dep has the 'required' attribute
Closes https://github.com/mesonbuild/meson/issues/992
-rw-r--r--mesonbuild/interpreter.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 3044d51..8aedcd7 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1856,12 +1856,10 @@ requirements use the version keyword argument instead.''')
# Cached dep has the wrong version. Check if an external
# dependency or a fallback dependency provides it.
cached_dep = None
-
# Don't re-use cached dep if it wasn't required but this one is,
# so we properly go into fallback/error code paths
- if 'required' in kwargs and cached_dep is not None:
- if not cached_dep.required and kwargs.get('required', True):
- cached_dep = None
+ if kwargs.get('required', True) and not getattr(cached_dep, 'required', False):
+ cached_dep = None
if cached_dep:
dep = cached_dep