mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
Merge pull request #7576 from deliangyang/main
Import plugins relative to the module
This commit is contained in:
commit
ac1f10fa82
|
@ -355,10 +355,11 @@ def init():
|
||||||
if _initialized >= 2:
|
if _initialized >= 2:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
parent_name = __name__.rpartition(".")[0]
|
||||||
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_name}.{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