summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2014-12-18 21:38:25 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2014-12-18 21:38:25 -0800
commit5cd4ddaf089471bb256174362122e010566b441e (patch)
tree73e3d53ee5ed70984dacb14b1be9b5017aaeacd1
parent08f1701e359073e4704489190e7708764cf8208a (diff)
downloadspack-5cd4ddaf089471bb256174362122e010566b441e.tar.gz
spack-5cd4ddaf089471bb256174362122e010566b441e.tar.bz2
spack-5cd4ddaf089471bb256174362122e010566b441e.tar.xz
spack-5cd4ddaf089471bb256174362122e010566b441e.zip
Fix for SPACK-49.
- name conflict in imp.load_source caused this to fail. - Python modules loaded by imp have unique names now.
-rw-r--r--lib/spack/spack/__init__.py2
-rw-r--r--lib/spack/spack/hooks/__init__.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index da7088640f..6697e00e40 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -26,7 +26,7 @@ import os
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
diff --git a/lib/spack/spack/hooks/__init__.py b/lib/spack/spack/hooks/__init__.py
index 4f0d574e49..98b7f2323f 100644
--- a/lib/spack/spack/hooks/__init__.py
+++ b/lib/spack/spack/hooks/__init__.py
@@ -47,8 +47,11 @@ import spack
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