bugfix: Avoid KeyError in compilers.yaml version check

This commit is contained in:
Todd Gamblin 2018-08-20 11:04:40 -07:00
parent 84140c6cd3
commit 83323f4e71

View file

@ -27,8 +27,8 @@ def check_compiler_yaml_version():
data = syaml.load(f)
if data:
compilers = data['compilers']
if len(compilers) > 0:
compilers = data.get('compilers')
if compilers and len(compilers) > 0:
if (not isinstance(compilers, list) or
'operating_system' not in compilers[0]['compiler']):
new_file = os.path.join(scope.path, '_old_compilers.yaml')