Skip to content

Commit b1f26c5

Browse files
committed
Corrected for Python 3.10
1 parent ce75466 commit b1f26c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,13 +1036,13 @@ def get_detailed_type(obj: Any) -> Type:
10361036

10371037
if obj_type in (list, set):
10381038
obj_origin_type = List if obj_type is list else Set
1039-
elems_type = Union[*{get_detailed_type(x) for x in obj}]
1039+
elems_type = Union[tuple({get_detailed_type(x) for x in obj})]
10401040
return obj_origin_type[elems_type]
10411041
elif obj_type is tuple:
10421042
return Tuple[tuple(get_detailed_type(x) for x in obj)]
10431043
elif obj_type is dict:
1044-
keys_type = Union[*{get_detailed_type(k) for k in obj.keys()}]
1045-
values_type = Union[*{get_detailed_type(k) for k in obj.values()}]
1044+
keys_type = Union[tuple({get_detailed_type(k) for k in obj.keys()})]
1045+
values_type = Union[tuple({get_detailed_type(k) for k in obj.values()})]
10461046
return Dict[keys_type, values_type]
10471047
else:
10481048
return obj_type

0 commit comments

Comments
 (0)