Skip to content

Commit

Permalink
Fix issue with overwriting duplicate keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
uiri committed Mar 4, 2013
1 parent eb7094d commit aa2fabb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion toml.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ def loads(s):
pair[0] = pair[0].strip()
pair[1] = pair[1].strip()
value = load_value(pair[1])
currentlevel[pair[0]] = value
try:
currentlevel[pair[0]]
raise Exception("Duplicate keys!")
except KeyError:
currentlevel[pair[0]] = value
return retval

def load_value(v):
Expand Down

0 comments on commit aa2fabb

Please sign in to comment.