comment out values of None without crashing, https://github.com/toml-lang/toml/issues/30
diff --git a/pytoml/writer.py b/pytoml/writer.py
index a43f6ad..e8d054a 100644
--- a/pytoml/writer.py
+++ b/pytoml/writer.py
@@ -100,6 +100,9 @@
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)))