Skip to content

Commit

Permalink
Fix enum for python<3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Jan 17, 2025
1 parent 1022e7a commit 6116205
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skore/src/skore/persistence/item/media_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def factory(
if not isinstance(media, str):
raise ItemTypeError(f"Type '{media.__class__}' is not supported.")

if media_type not in MediaType:
if media_type not in MediaType._value2member_map_:
raise ValueError(f"MIME type '{media_type}' is not supported.")

return cls(media, media_type, **kwargs)
Expand Down

0 comments on commit 6116205

Please sign in to comment.