From a7f2abf9242ad321b410cc2f43b394856facba23 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Wed, 19 Jul 2023 11:08:51 +0200 Subject: Remove `LazyReference` from code (#38944) A LazyReference object is a reference to an attribute of a lazily evaluated singleton. Its only purpose is to let developers use shorter names to refer to such attribute. This class does more harm than good, as it obfuscates the fact that we are using the attribute of a global object. Also, it can easily go out of sync with the singleton it refers to if, for instance, the singleton is updated but the references are not. This commit removes the LazyReference class entirely, and access the attributes explicitly passing through the global value to which they are attached. --- var/spack/repos/builtin.mock/packages/old-sbang/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin.mock/packages/old-sbang/package.py b/var/spack/repos/builtin.mock/packages/old-sbang/package.py index c82696460d..2f7e8505b0 100644 --- a/var/spack/repos/builtin.mock/packages/old-sbang/package.py +++ b/var/spack/repos/builtin.mock/packages/old-sbang/package.py @@ -30,7 +30,7 @@ class OldSbang(Package): {1} """.format( - spack.store.unpadded_root, prefix.bin + spack.store.STORE.unpadded_root, prefix.bin ) with open("%s/sbang-style-1.sh" % self.prefix.bin, "w") as f: f.write(sbang_style_1) -- cgit v1.2.3-70-g09d2