Skip to content

Commit dde24f7

Browse files
authored
Fix regression in Python 3.10 (#68)
1 parent 281a42a commit dde24f7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

confection/_registry.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,11 @@ def _make_unresolved_schema(
268268
)
269269
elif field.annotation is None:
270270
fields[name] = (Any, Field(field.default))
271-
elif issubclass(field.annotation, BaseModel):
271+
elif (
272+
# On Python 3.10, typing.* objects were not classes
273+
isinstance(field.annotation, type)
274+
and issubclass(field.annotation, BaseModel)
275+
):
272276
fields[name] = cls._make_unresolved_schema(
273277
field.annotation, config[name]
274278
)

0 commit comments

Comments
 (0)