m = re.match(r'.* policy<(.*?)>', line)
if m:
match = True
- entry['policy'] |= literal_eval(m.group(1))
+ try:
+ entry['policy'] |= literal_eval(m.group(1))
+ except TypeError:
+ entry['policy'] = {**entry['policy'], **literal_eval(m.group(1))}
m = re.match(r'.* note<(.*?)>', line)
if m:
# Determine if we need to import all configs or a single config
if not configs:
configs = c.config.keys()
- configs |= self.search_config(arch=arch, flavour=flavour).keys()
+ try:
+ configs |= self.search_config(arch=arch, flavour=flavour).keys()
+ except TypeError:
+ configs = {**configs, **self.search_config(arch=arch, flavour=flavour).keys()}
# Import configs from the Kconfig object into Annotations
if flavour is not None:
# If new_val is a subset of old_val, skip it
old_val = tmp_a.config.get(conf)
if old_val and 'policy' in old_val:
- if old_val['policy'] == old_val['policy'] | new_val['policy']:
- continue
+ try:
+ if old_val['policy'] == old_val['policy'] | new_val['policy']:
+ continue
+ except TypeError:
+ if old_val['policy'] == {**old_val['policy'], **new_val['policy']}:
+ continue
# Write out the policy (and note) line(s)
val = dict(sorted(new_val['policy'].items()))