Skip to content

Commit

Permalink
fix: -1 index error when setting dotted key
Browse files Browse the repository at this point in the history
Fixes #332

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming committed Feb 27, 2024
1 parent 0c2c30d commit 2348fcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixed

- Support `|` and `|=` operator for tables, and support `+` and `+=` operator for arrays. ([#331](https://github.com/sdispater/tomlkit/issues/331))
- Fix an index error when setting dotted keys in a table. ([#332](https://github.com/sdispater/tomlkit/issues/332))

## [0.12.3] - 2023-11-15

Expand Down
4 changes: 2 additions & 2 deletions tomlkit/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ def append(
if item.is_super_table():
# We need to merge both super tables
if (
self._table_keys[-1] != current_body_element[0]
or key.is_dotted()
key.is_dotted()
or current_body_element[0].is_dotted()
or self._table_keys[-1] != current_body_element[0]
):
if key.is_dotted() and not self._parsed:
idx = self._get_last_index_before_table()
Expand Down

0 comments on commit 2348fcf

Please sign in to comment.