From f96b54b0a63713d50f956abb4930d99ee37eb58e Mon Sep 17 00:00:00 2001 From: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> Date: Thu, 11 Aug 2022 05:09:53 -0700 Subject: info: properly report default when for overridden variants (#32040) --- lib/spack/spack/cmd/info.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/spack') diff --git a/lib/spack/spack/cmd/info.py b/lib/spack/spack/cmd/info.py index 97417eed3a..ce69d98dbb 100644 --- a/lib/spack/spack/cmd/info.py +++ b/lib/spack/spack/cmd/info.py @@ -145,10 +145,8 @@ class VariantFormatter(object): name = textwrap.wrap( "{0} [{1}]".format(k, self.default(v)), width=self.column_widths[0] ) - if len(w) == 1: - w = w[0] - if w == spack.spec.Spec(): - w = "--" + if all(spec == spack.spec.Spec() for spec in w): + w = "--" when = textwrap.wrap(str(w), width=self.column_widths[1]) allowed = v.allowed_values.replace("True, False", "on, off") allowed = textwrap.wrap(allowed, width=self.column_widths[2]) -- cgit v1.2.3-70-g09d2