Skip to content

Commit

Permalink
Merge pull request #31 from V1dV1d/main
Browse files Browse the repository at this point in the history
fix booleans causing the sorter to fail
  • Loading branch information
pappasam committed Dec 28, 2022
2 parents 3edbcf4 + bca44f5 commit f9565c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion toml_sort/tomlsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def convert_tomlkit_buggy_types(in_value: Any, parent: Any, key: str) -> Item:
if isinstance(in_value, bool):
# Bool items don't have trivia and are resolved to Python's `bool`
# https://github.com/sdispater/tomlkit/issues/119#issuecomment-955840942
return parent.value.item(key)
try:
return parent.value.item(key)
except AttributeError:
return item(parent.value[key], parent)
if isinstance(in_value, Item):
return in_value
if isinstance(in_value, Container):
Expand Down

0 comments on commit f9565c8

Please sign in to comment.