Fix for SPACK-49.

- name conflict in imp.load_source caused this to fail.
- Python modules loaded by imp have unique names now.
This commit is contained in:
Todd Gamblin 2014-12-18 21:38:25 -08:00
parent 08f1701e35
commit 5cd4ddaf08
2 changed files with 5 additions and 2 deletions

View File

@ -26,7 +26,7 @@
import tempfile
from llnl.util.filesystem import *
# This lives in $prefix/lib/spac/spack/__file__
# This lives in $prefix/lib/spack/spack/__file__
prefix = ancestor(__file__, 4)
# The spack script itself

View File

@ -47,8 +47,11 @@
def all_hook_modules():
modules = []
for name in list_modules(spack.hooks_path):
mod_name = __name__ + '.' + name
path = join_path(spack.hooks_path, name) + ".py"
modules.append(imp.load_source('spack.hooks', path))
mod = imp.load_source(mod_name, path)
modules.append(mod)
return modules