diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index a919ee5ceeb..ab02f46222f 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -1574,7 +1574,7 @@ def matching_spec(self, spec): if abstract) if len(root_matches) == 1: - return list(root_matches.items())[0][1] + return list(root_matches.items())[0][0] # More than one spec matched, and either multiple roots matched or # none of the matches were roots