mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-13 01:32:18 +03:00
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:
parent
f9c7bd8611
commit
6825a76692
|
@ -355,10 +355,11 @@ def init():
|
||||||
if _initialized >= 2:
|
if _initialized >= 2:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
parent_module, _, _ = __name__.rpartition(".")
|
||||||
for plugin in _plugins:
|
for plugin in _plugins:
|
||||||
try:
|
try:
|
||||||
logger.debug("Importing %s", plugin)
|
logger.debug("Importing %s", plugin)
|
||||||
__import__(f"PIL.{plugin}", globals(), locals(), [])
|
__import__(f"{parent_module}.{plugin}", globals(), locals(), [])
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
logger.debug("Image: failed to import %s: %s", plugin, e)
|
logger.debug("Image: failed to import %s: %s", plugin, e)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user