Skip to content

Commit

Permalink
Add forward compatibility for Pydantic v2 (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Nov 4, 2023
1 parent 3078d8a commit 018006c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tailscale/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@

from typing import TYPE_CHECKING, Any

from pydantic import BaseModel, Field, validator
try:
from pydantic.v1 import BaseModel, Field, validator
except ImportError: # pragma: no cover
from pydantic import ( # type: ignore[assignment] # pragma: no cover
BaseModel,
Field,
validator,
)

if TYPE_CHECKING:
from datetime import datetime
Expand Down

0 comments on commit 018006c

Please sign in to comment.