Skip to content

Commit

Permalink
Replace use of deprecated pydantic.json.pydantic_encoder. (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Sep 27, 2024
1 parent a331848 commit 1784e8c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/antsibull/announcements.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ def write_announcements_json(info: AnnouncementsInfo, file: StrOrBytesPath) -> N
file: Output JSON filename
"""
with open(file, "w", encoding="utf-8") as fp:
# pylint doesn't understand pydantic's __getattr__ magic
# pylint: disable-next=no-member
json.dump(info, fp, default=pydantic.json.pydantic_encoder, indent=2)
fp.write(info.model_dump_json(indent=2))


def load_announcements_json(file: StrOrBytesPath) -> AnnouncementsInfo:
Expand Down

0 comments on commit 1784e8c

Please sign in to comment.