glib-mkenums: Ignore other per value options than 'skip' and 'nick'

If some other per value option was present than 'skip' or 'nick' then
a KeyError would occur. Ignoring such options matches the behaviour of
the old, Perl-based glib-mkenums.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>

https://gitlab.gnome.org/GNOME/glib/issues/1360
This commit is contained in:
Peter Kjellerstedt 2018-04-28 03:07:50 +02:00 committed by Philip Withnall
parent 4993f2b7e5
commit c0e6fa4f19

View File

@ -218,7 +218,7 @@ def parse_entries(file, file_name):
if options is not None:
options = parse_trigraph(options)
if 'skip' not in options:
entries.append((name, value, options['nick']))
entries.append((name, value, options.get('nick')))
else:
entries.append((name, value))
elif re.match(r's*\#', line):