mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-14 01:04:45 +03:00
use ID as global variable
This commit is contained in:
parent
f992192799
commit
e23140f594
|
@ -2287,6 +2287,7 @@ def open(fp, mode="r"):
|
|||
preinit()
|
||||
|
||||
def _open_core(fp, filename, prefix):
|
||||
global ID
|
||||
for i in ID:
|
||||
try:
|
||||
factory, accept = OPEN[i]
|
||||
|
@ -2428,6 +2429,8 @@ def register_open(id, factory, accept=None):
|
|||
:param accept: An optional function that can be used to quickly
|
||||
reject images having another format.
|
||||
"""
|
||||
global ID
|
||||
|
||||
id = id.upper()
|
||||
ID.append(id)
|
||||
OPEN[id] = factory, accept
|
||||
|
|
Loading…
Reference in New Issue
Block a user