mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Unconditionally import turbojpeg from camera (#141995)
This commit is contained in:
parent
145e02769c
commit
fa9613a879
@ -2,17 +2,10 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import suppress
|
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING, Literal, cast
|
from typing import TYPE_CHECKING, Literal, cast
|
||||||
|
|
||||||
with suppress(Exception):
|
from turbojpeg import TurboJPEG
|
||||||
# TurboJPEG imports numpy which may or may not work so
|
|
||||||
# we have to guard the import here. We still want
|
|
||||||
# to import it at top level so it gets loaded
|
|
||||||
# in the import executor and not in the event loop.
|
|
||||||
from turbojpeg import TurboJPEG
|
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from . import Image
|
from . import Image
|
||||||
|
Loading…
x
Reference in New Issue
Block a user