Skip to content

Commit

Permalink
fix: Importing plugins from a user-specified installation directory
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
deliangyang authored and jaxx0n committed Nov 28, 2023
1 parent f9c7bd8 commit 6825a76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6825a76

Please sign in to comment.