* 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.
This commit is contained in:
parent
5510bba1fd
commit
3dbafb5ee7
1 changed files with 3 additions and 2 deletions
|
@ -651,8 +651,7 @@ def is_relocatable(spec):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def file_is_relocatable(
|
def file_is_relocatable(file, paths_to_relocate=None):
|
||||||
file, paths_to_relocate=[spack.store.layout.root, spack.paths.prefix]):
|
|
||||||
"""Returns True if the file passed as argument is relocatable.
|
"""Returns True if the file passed as argument is relocatable.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -665,6 +664,8 @@ def file_is_relocatable(
|
||||||
|
|
||||||
ValueError: if the file does not exist or the path is not absolute
|
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'
|
if not (platform.system().lower() == 'darwin'
|
||||||
or platform.system().lower() == 'linux'):
|
or platform.system().lower() == 'linux'):
|
||||||
|
|
Loading…
Reference in a new issue