mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 16:24:11 +03:00
Moved case transformation before initialization check
This commit is contained in:
parent
0c1675a143
commit
587e073dac
|
@ -2922,10 +2922,11 @@ def open(fp, mode="r", formats=None):
|
||||||
|
|
||||||
def _open_core(fp, filename, prefix, formats):
|
def _open_core(fp, filename, prefix, formats):
|
||||||
for i in formats:
|
for i in formats:
|
||||||
|
i = i.upper()
|
||||||
if i not in OPEN:
|
if i not in OPEN:
|
||||||
init()
|
init()
|
||||||
try:
|
try:
|
||||||
factory, accept = OPEN[i.upper()]
|
factory, accept = OPEN[i]
|
||||||
result = not accept or accept(prefix)
|
result = not accept or accept(prefix)
|
||||||
if type(result) in [str, bytes]:
|
if type(result) in [str, bytes]:
|
||||||
accept_warnings.append(result)
|
accept_warnings.append(result)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user