Skip to content

Commit

Permalink
ids were based on the string, rather than the actual object which cau…
Browse files Browse the repository at this point in the history
…ses incorrect detection of circular references (#303)

Fix #295

Co-authored-by: Dirk-Philip van Herwaarden <dirkphilip@dirkphilipsmbp.home>
  • Loading branch information
dirkphilip and dirkphilip authored Aug 22, 2020
1 parent a952ed8 commit 9be6458
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion toml/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def dumps(o, encoder=None):
retval += addtoretval
outer_objs = [id(o)]
while sections:
section_ids = [id(section) for section in sections]
section_ids = [id(section) for section in sections.values()]
for outer_obj in outer_objs:
if outer_obj in section_ids:
raise ValueError("Circular reference detected")
Expand Down

0 comments on commit 9be6458

Please sign in to comment.