Skip to content

Commit

Permalink
Fix pushsource-ls unable to serialize frozendict (on some versions)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rohanpm committed Oct 31, 2024
1 parent 424a689 commit 45d294c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pushsource/_impl/list_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

import attr
import yaml
from frozendict.core import frozendict

import pushsource
from pushsource import Source
Expand Down Expand Up @@ -57,6 +58,7 @@ def add_enum_representers(cls):


ItemDumper.add_enum_representers()
ItemDumper.add_representer(frozendict, ItemDumper.represent_dict)


def format_python(item):
Expand Down

0 comments on commit 45d294c

Please sign in to comment.