summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/audit.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/spack/spack/audit.py b/lib/spack/spack/audit.py
index 47894383a5..f6ef90e0b8 100644
--- a/lib/spack/spack/audit.py
+++ b/lib/spack/spack/audit.py
@@ -389,9 +389,8 @@ def _unknown_variants_in_dependencies(pkgs, error_cls):
dependency_variants = dependency_edge.spec.variants
for name, value in dependency_variants.items():
try:
- dependency_pkg.variants[name].validate_or_raise(
- value, pkg=dependency_pkg
- )
+ v, _ = dependency_pkg.variants[name]
+ v.validate_or_raise(value, pkg=dependency_pkg)
except Exception as e:
summary = (pkg_name + ": wrong variant used for a "
"dependency in a 'depends_on' directive")
@@ -419,7 +418,8 @@ def _analyze_variants_in_directive(pkg, constraint, directive, error_cls):
errors = []
for name, v in constraint.variants.items():
try:
- pkg.variants[name].validate_or_raise(v, pkg=pkg)
+ variant, _ = pkg.variants[name]
+ variant.validate_or_raise(v, pkg=pkg)
except variant_exceptions as e:
summary = pkg.name + ': wrong variant in "{0}" directive'
summary = summary.format(directive)