diff options
author | Tim Fuller <tjfulle@sandia.gov> | 2019-11-15 14:32:58 -0700 |
---|---|---|
committer | Greg Becker <becker33@llnl.gov> | 2019-11-15 13:32:58 -0800 |
commit | 3dbafb5ee7f582b395cba3783ddba5cc579dbd16 (patch) | |
tree | 73a6b5dce75f266d8a52cc166bfd87ec5d9a818c /lib | |
parent | 5510bba1fdb086eddec66b3e13792e08caa4590e (diff) | |
download | spack-3dbafb5ee7f582b395cba3783ddba5cc579dbd16.tar.gz spack-3dbafb5ee7f582b395cba3783ddba5cc579dbd16.tar.bz2 spack-3dbafb5ee7f582b395cba3783ddba5cc579dbd16.tar.xz spack-3dbafb5ee7f582b395cba3783ddba5cc579dbd16.zip |
Fix for issue #13754 (#13755)
* remove reference to `spack.store` in method definition
Referencing `spack.store` in method definition will cache the `spack.config.config` singleton variable too early, before we have a chance to add command line and environment scopes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/relocate.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/spack/spack/relocate.py b/lib/spack/spack/relocate.py index 4cbe6d64c6..8b1f3422d2 100644 --- a/lib/spack/spack/relocate.py +++ b/lib/spack/spack/relocate.py @@ -651,8 +651,7 @@ def is_relocatable(spec): return True -def file_is_relocatable( - file, paths_to_relocate=[spack.store.layout.root, spack.paths.prefix]): +def file_is_relocatable(file, paths_to_relocate=None): """Returns True if the file passed as argument is relocatable. Args: @@ -665,6 +664,8 @@ def file_is_relocatable( ValueError: if the file does not exist or the path is not absolute """ + default_paths_to_relocate = [spack.store.layout.root, spack.paths.prefix] + paths_to_relocate = paths_to_relocate or default_paths_to_relocate if not (platform.system().lower() == 'darwin' or platform.system().lower() == 'linux'): |