diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 15eef1a748d..9d1027dd0bb 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -4861,8 +4861,8 @@ def from_node_dict(cls, node): spec.external_modules = node["external"]["module"] if spec.external_modules is False: spec.external_modules = None - spec.extra_attributes = node["external"].get( - "extra_attributes", syaml.syaml_dict() + spec.extra_attributes = ( + node["external"].get("extra_attributes") or syaml.syaml_dict() ) # specs read in are concrete unless marked abstract