Skip to content
Snippets Groups Projects
Commit b4fe7d00 authored by Josh Austin's avatar Josh Austin
Browse files

comment out values of None without crashing, https://github.com/toml-lang/toml/issues/30

parent b5a70627
No related branches found
No related tags found
No related merge requests found
......@@ -100,6 +100,9 @@ def dump(fout, obj):
tables.append((name + (k,), v, False))
elif isinstance(v, list) and v and all(isinstance(o, dict) for o in v):
tables.extend((name + (k,), d, True) for d in reversed(v))
elif v is None:
fout.write(
'#{} = VALUE # To use: uncomment and replace VALUE with your own value.\n'.format(_escape_id(k)))
else:
fout.write('{} = {}\n'.format(_escape_id(k), _format_value(v)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment