Skip to content

Commit

Permalink
fix: handle missing pydantic-core corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
elventear committed May 10, 2024
1 parent 98a933d commit 89de5d2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cappa/class_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,14 @@ def from_cls(cls, obj: type) -> ClassTypes | None:
return cls.msgspec

try:
from pydantic import BaseModel
import pydantic
except ImportError: # pragma: no cover
pass
else:
try:
is_base_model = isinstance(obj, type) and issubclass(
obj, pydantic.BaseModel
obj, BaseModel
)
except TypeError: # pragma: no cover
is_base_model = False
Expand Down

0 comments on commit 89de5d2

Please sign in to comment.