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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user