Skip to content

Commit a887d63

Browse files
committed
fixed up subclass check in to_mime
1 parent 41db61b commit a887d63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fileformats/core/identification.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ def to_mime(
128128
namespace scheme instead of putting all non-standard types into the 'application'
129129
registry if not
130130
"""
131-
if not issubclass(datatype, fileformats.core.FileSet):
131+
origin = ty.get_origin(datatype)
132+
if origin is None and not issubclass(datatype, fileformats.core.DataType):
132133
raise TypeError(
133134
f"Cannot convert {datatype} to mime-type as it is not a file-set class"
134135
)
135-
origin = ty.get_origin(datatype)
136136
if official and (origin or datatype.namespace == "field"):
137137
raise TypeError(
138138
f"Cannot convert {datatype} to official mime-type as it is not a proper "

0 commit comments

Comments
 (0)