Fix for 'Parent module spack.operating_systems not found while handling absolute import'

This commit is contained in:
Mario Melara 2016-02-25 10:34:55 -08:00
parent 8d1c06d141
commit 863a5bc4fa

View File

@ -67,26 +67,26 @@ def __init__(self, name, compiler_strategy, module_name=None):
def set_platform(self, platform): def set_platform(self, platform):
self.platform_name = platform.name self.platform_name = platform.name
def to_dict(self): #def to_dict(self):
d = {} # d = {}
d['name'] = self.name # d['name'] = self.name
d['compiler_strategy'] = self.compiler_strategy # d['compiler_strategy'] = self.compiler_strategy
d['module_name'] = self.module_name # d['module_name'] = self.module_name
if self.platform_name: # if self.platform_name:
d['platform'] = self.platform_name # d['platform'] = self.platform_name
return d # return d
@staticmethod #@staticmethod
def from_dict(d): #def from_dict(d):
if d is None: # if d is None:
return None # return None
target = Target.__new__(Target) # target = Target.__new__(Target)
target.name = d['name'] # target.name = d['name']
target.compiler_strategy = d['compiler_strategy'] # target.compiler_strategy = d['compiler_strategy']
target.module_name = d['module_name'] # target.module_name = d['module_name']
if 'platform' in d: # if 'platform' in d:
target.platform_name = d['platform'] # target.platform_name = d['platform']
return target # return target
def _cmp_key(self): def _cmp_key(self):
return (self.name, self.module_name) return (self.name, self.module_name)
@ -326,7 +326,7 @@ def all_platforms(operating_system=False):
if operating_system: if operating_system:
mod_path = spack.operating_system_path mod_path = spack.operating_system_path
mod_string = "spack.operating_system." mod_string = "spack.operating_systems"
else: else:
mod_path = spack.platform_path mod_path = spack.platform_path
mod_string = "spack.platformss" mod_string = "spack.platformss"