Skip to content

Commit 712dba7

Browse files
authored
fix: -1 index error when setting dotted keyFixes #332Signed-off-by: Frost Ming <[email protected]>
* fix: -1 index error when setting dotted key Fixes #332 Signed-off-by: Frost Ming <[email protected]>
1 parent 0c2c30d commit 712dba7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixed
66

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

910
## [0.12.3] - 2023-11-15
1011

tomlkit/container.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ def append(
227227
if item.is_super_table():
228228
# We need to merge both super tables
229229
if (
230-
self._table_keys[-1] != current_body_element[0]
231-
or key.is_dotted()
230+
key.is_dotted()
232231
or current_body_element[0].is_dotted()
232+
or self._table_keys[-1] != current_body_element[0]
233233
):
234234
if key.is_dotted() and not self._parsed:
235235
idx = self._get_last_index_before_table()

0 commit comments

Comments
 (0)