Skip to content

Commit

Permalink
Merge pull request #6811 from radarhere/registered_extensions
Browse files Browse the repository at this point in the history
Resolves #6809
  • Loading branch information
hugovk committed Dec 23, 2022
2 parents edcfe09 + c6d1fdd commit f9c88c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
6 changes: 0 additions & 6 deletions Tests/test_image.py
Expand Up @@ -401,19 +401,13 @@ def test_alpha_inplace(self):
def test_registered_extensions_uninitialized(self):
# Arrange
Image._initialized = 0
extension = Image.EXTENSION
Image.EXTENSION = {}

# Act
Image.registered_extensions()

# Assert
assert Image._initialized == 2

# Restore the original state and assert
Image.EXTENSION = extension
assert Image.EXTENSION

def test_registered_extensions(self):
# Arrange
# Open an image to trigger plugin registration
Expand Down
3 changes: 1 addition & 2 deletions src/PIL/Image.py
Expand Up @@ -3417,8 +3417,7 @@ def registered_extensions():
Returns a dictionary containing all file extensions belonging
to registered plugins
"""
if not EXTENSION:
init()
init()
return EXTENSION


Expand Down

0 comments on commit f9c88c9

Please sign in to comment.