stree.StringTree.py.__set(): Disable assert self.content != str(content)

There's an assertion in StringTree.py.__set(), assert self.content !=
str(content), which often triggers. Not sure what the idea behind the
assertion was, disable it.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2025-05-12 18:57:16 +02:00
commit d30c41b03d

View file

@ -65,7 +65,7 @@ class StringTree: # export
def __set(self, path_, content, split=True): def __set(self, path_, content, split=True):
slog(DEBUG, ('At "{}": '.format(str(self.content)) if hasattr(self, "content") else "") + f'Setting "{path_}" -> "{content}"') slog(DEBUG, ('At "{}": '.format(str(self.content)) if hasattr(self, "content") else "") + f'Setting "{path_}" -> "{content}"')
assert self.content != str(content) #assert self.content != str(content) # Not sure what the idea behind this was. It often goes off, and all works fine without.
if content is not None and not type(content) in [str, StringTree]: if content is not None and not type(content) in [str, StringTree]:
raise Exception("Tried to add content of unsupported type {}".format(type(content).__name__)) raise Exception("Tried to add content of unsupported type {}".format(type(content).__name__))
if path_ is None: if path_ is None: