fix: Importing plugins from a user-specified installation directory

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

fix: Wrong path replacement

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

fix: typo
This commit is contained in:
Deliang Yang 2023-11-27 17:02:11 +08:00 committed by helloworld
parent f9c7bd8611
commit 6825a76692

View File

@ -355,10 +355,11 @@ def init():
if _initialized >= 2:
return 0
parent_module, _, _ = __name__.rpartition(".")
for plugin in _plugins:
try:
logger.debug("Importing %s", plugin)
__import__(f"PIL.{plugin}", globals(), locals(), [])
__import__(f"{parent_module}.{plugin}", globals(), locals(), [])
except ImportError as e:
logger.debug("Image: failed to import %s: %s", plugin, e)