Skip to content

Commit

Permalink
nvchecker: turn YAML's null values into empty strings
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Jul 18, 2024
1 parent e048b88 commit 5ff2e34
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lilac2/nvchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,14 @@ def _gen_config_from_lilacinfos(
newconfig[f'{name}'] = conf
else:
newconfig[f'{name}:{i}'] = conf
# Avoid empty-value keys as nvchecker can't handle that

for key, value in conf.items():
if key == 'to_pattern':
continue
if value in [None, '']:
# TOML doesn't have None, but YAML doesn't distinguish '' and None
if value is None:
conf[key] = ''
elif value in [None, '']:
# compat with old config convention
conf[key] = name
counts[name] = len(confs)

Expand Down

0 comments on commit 5ff2e34

Please sign in to comment.