mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
Use relative import
This commit is contained in:
parent
f3aec6dd38
commit
c7e6289b36
|
@ -7,9 +7,9 @@ import warnings
|
||||||
from typing import IO
|
from typing import IO
|
||||||
|
|
||||||
import PIL
|
import PIL
|
||||||
from PIL import _deprecate
|
|
||||||
|
|
||||||
from . import Image
|
from . import Image
|
||||||
|
from ._deprecate import deprecate
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
"pil": ("PIL._imaging", "PILLOW_VERSION"),
|
"pil": ("PIL._imaging", "PILLOW_VERSION"),
|
||||||
|
@ -149,7 +149,7 @@ def check_feature(feature: str) -> bool | None:
|
||||||
try:
|
try:
|
||||||
imported_module = __import__(module, fromlist=["PIL"])
|
imported_module = __import__(module, fromlist=["PIL"])
|
||||||
if isinstance(flag, bool):
|
if isinstance(flag, bool):
|
||||||
_deprecate.deprecate(f'check_feature("{feature}")', 12)
|
deprecate(f'check_feature("{feature}")', 12)
|
||||||
return flag
|
return flag
|
||||||
return getattr(imported_module, flag)
|
return getattr(imported_module, flag)
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user