Skip to content

Commit a271105

Browse files
chore: add missing isclass check (#2316)
1 parent 09f456c commit a271105

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cloudflare/_models.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,11 @@ def construct_type(*, value: object, type_: object) -> object:
488488
_, items_type = get_args(type_) # Dict[_, items_type]
489489
return {key: construct_type(value=item, type_=items_type) for key, item in value.items()}
490490

491-
if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)):
491+
if (
492+
not is_literal_type(type_)
493+
and inspect.isclass(origin)
494+
and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel))
495+
):
492496
if is_list(value):
493497
return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value]
494498

0 commit comments

Comments
 (0)