Avoid KeyError Exceptions.

Co-Authored-By: theotherjimmy <theotherjimmy@gmail.com>
pull/8757/head
Brian Daniels 2018-11-16 09:47:55 -06:00 committed by Jimmy Brisson
parent 4af70dcaa1
commit dbbf336949
1 changed files with 1 additions and 1 deletions

View File

@ -652,7 +652,7 @@ class Config(object):
def _get_mem_specs(self, permissions, cmsis_part):
all_matching_memories = {
name: memory for name, memory in cmsis_part['memories'].items()
if all(memory['access'][perm] for perm in permissions)
if all(memory['access'].get(perm) for perm in permissions)
}
if all_matching_memories:
return all_matching_memories