Skip to content

Commit

Permalink
fix: use parent_name instead of parent_module
Browse files Browse the repository at this point in the history
  • Loading branch information
jaxx0n committed Nov 28, 2023
1 parent 6825a76 commit b235aa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,11 @@ def init():
if _initialized >= 2:
return 0

parent_module, _, _ = __name__.rpartition(".")
parent_name = __name__.rpartition(".")[0]

Check warning on line 358 in src/PIL/Image.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/Image.py#L358

Added line #L358 was not covered by tests
for plugin in _plugins:
try:
logger.debug("Importing %s", plugin)
__import__(f"{parent_module}.{plugin}", globals(), locals(), [])
__import__(f"{parent_name}.{plugin}", globals(), locals(), [])

Check warning on line 362 in src/PIL/Image.py

View check run for this annotation

Codecov / codecov/patch

src/PIL/Image.py#L362

Added line #L362 was not covered by tests
except ImportError as e:
logger.debug("Image: failed to import %s: %s", plugin, e)

Expand Down

0 comments on commit b235aa9

Please sign in to comment.