From 45d294c92893f3eff0705c3f11488cc9a442bc91 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Thu, 31 Oct 2024 11:47:14 +1100 Subject: [PATCH] Fix pushsource-ls unable to serialize frozendict (on some versions) On at least some pyyaml and frozendict versions, it is necessary to explicitly add a representer for the frozendict type, as it will not automatically be processed in the same way as a regular dict. --- src/pushsource/_impl/list_cmd.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pushsource/_impl/list_cmd.py b/src/pushsource/_impl/list_cmd.py index 66f8123a..7e484cd5 100755 --- a/src/pushsource/_impl/list_cmd.py +++ b/src/pushsource/_impl/list_cmd.py @@ -29,6 +29,7 @@ import attr import yaml +from frozendict.core import frozendict import pushsource from pushsource import Source @@ -57,6 +58,7 @@ def add_enum_representers(cls): ItemDumper.add_enum_representers() +ItemDumper.add_representer(frozendict, ItemDumper.represent_dict) def format_python(item):