From cfc99766fc9fc4f05c57c45487bea319e96e1eba Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Fri, 22 Sep 2023 09:03:44 +0800 Subject: [PATCH] fix: error when overwriting a sub table Fix #313 Signed-off-by: Frost Ming --- CHANGELOG.md | 4 ++++ tomlkit/items.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6a2b8d..a1bd730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +- Fixed a bug that overwriting a sub table with a plain value raises an error. ([#313](https://github.com/sdispater/tomlkit/issues/313)) + ## [0.12.2] - 2023-09-20 ### Fixed diff --git a/tomlkit/items.py b/tomlkit/items.py index f6346ac..31f63f8 100644 --- a/tomlkit/items.py +++ b/tomlkit/items.py @@ -1945,7 +1945,7 @@ class Null(Item): """ def __init__(self) -> None: - pass + super().__init__(Trivia(trail="")) def unwrap(self) -> None: return None