0.9.1 Add license note. Fix minor bug with large numbers
diff --git a/setup.py b/setup.py index 1f16da7..d11cef2 100644 --- a/setup.py +++ b/setup.py
@@ -3,7 +3,7 @@ with open("README.rst") as readmefile: readme = readmefile.read() setup(name='toml', - version='0.9.0', + version='0.9.1', description="Python Library for Tom's Obvious, Minimal Language", author="Uiri Noyb", author_email="uiri@xqz.ca",
diff --git a/toml.py b/toml.py index f272372..5d837a6 100644 --- a/toml.py +++ b/toml.py
@@ -1,3 +1,5 @@ +# This software is released under the MIT license + import datetime, decimal, re class TomlTz(datetime.tzinfo): @@ -458,7 +460,7 @@ if v[0] == '-': neg = True v = v[1:] - if '.' in v: + if '.' in v or 'e' in v: if v.split('.', 1)[1] == '': raise Exception("This float is missing digits after the point") if v[0] not in digits: @@ -625,7 +627,7 @@ if isinstance(v, datetime.datetime): return v.isoformat()[:19]+'Z' if isinstance(v, float): - return '{0:f}'.format(decimal.Decimal(str(v))) + return str(v) return v def toml_merge_dict(a, b):