two minor fixes
This commit is contained in:
commit
3fcd54203c
@ -74,7 +74,7 @@ def _to_dict(compiler):
|
|||||||
d['spec'] = str(compiler.spec)
|
d['spec'] = str(compiler.spec)
|
||||||
d['paths'] = dict( (attr, getattr(compiler, attr, None)) for attr in _path_instance_vars )
|
d['paths'] = dict( (attr, getattr(compiler, attr, None)) for attr in _path_instance_vars )
|
||||||
d['operating_system'] = str(compiler.operating_system)
|
d['operating_system'] = str(compiler.operating_system)
|
||||||
d['modules'] = compiler.modules
|
d['modules'] = compiler.modules if compiler.modules else []
|
||||||
|
|
||||||
if compiler.alias:
|
if compiler.alias:
|
||||||
d['alias'] = compiler.alias
|
d['alias'] = compiler.alias
|
||||||
|
@ -46,7 +46,7 @@ def check_compiler_yaml_version():
|
|||||||
if data:
|
if data:
|
||||||
compilers = data['compilers']
|
compilers = data['compilers']
|
||||||
if len(compilers) > 0:
|
if len(compilers) > 0:
|
||||||
if 'operating_system' not in compilers[0]['compiler']:
|
if (not isinstance(compilers, list)) or 'operating_system' not in compilers[0]['compiler']:
|
||||||
new_file = os.path.join(scope.path, '_old_compilers.yaml')
|
new_file = os.path.join(scope.path, '_old_compilers.yaml')
|
||||||
tty.warn('%s in out of date compilers format. '
|
tty.warn('%s in out of date compilers format. '
|
||||||
'Moved to %s. Spack automatically generate '
|
'Moved to %s. Spack automatically generate '
|
||||||
|
Loading…
Reference in New Issue
Block a user