mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Use pydantic.v1 namespace on all pydantic versions (#883)
With https://github.com/pydantic/pydantic/pull/9042 being shipped with [1.10.15](https://docs.pydantic.dev/latest/changelog/#v11015-2024-04-03), we can clean up the imports a bit until we make decisions how to move onward with or without pydantic. --------- Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -12,11 +12,7 @@ from typing import Awaitable, Callable, Dict, Optional, Type, cast
|
||||
# When support for cpython older than 3.11 is dropped
|
||||
# async_timeout can be replaced with asyncio.timeout
|
||||
from async_timeout import timeout as asyncio_timeout
|
||||
|
||||
try:
|
||||
from pydantic.v1 import BaseModel, ValidationError # pragma: no cover
|
||||
except ImportError:
|
||||
from pydantic import BaseModel, ValidationError # pragma: no cover
|
||||
from pydantic.v1 import BaseModel, ValidationError
|
||||
|
||||
from kasa import Device
|
||||
from kasa.credentials import Credentials
|
||||
|
Reference in New Issue
Block a user