Skip to content

Commit

Permalink
Merge pull request #2 from radarhere/open_formats_case
Browse files Browse the repository at this point in the history
Moved case transformation before initialization check
  • Loading branch information
Piolie committed Feb 5, 2021
2 parents 4a9a999 + 587e073 commit 957cc1b
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 @@ -2922,10 +2922,11 @@ def open(fp, mode="r", formats=None):

def _open_core(fp, filename, prefix, formats):
for i in formats:
i = i.upper()
if i not in OPEN:
init()
try:
factory, accept = OPEN[i.upper()]
factory, accept = OPEN[i]
result = not accept or accept(prefix)
if type(result) in [str, bytes]:
accept_warnings.append(result)
Expand Down

0 comments on commit 957cc1b

Please sign in to comment.