mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-16 02: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()
|
preinit()
|
||||||
|
|
||||||
def _open_core(fp, filename, prefix):
|
def _open_core(fp, filename, prefix):
|
||||||
|
global ID
|
||||||
for i in ID:
|
for i in ID:
|
||||||
try:
|
try:
|
||||||
factory, accept = OPEN[i]
|
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
|
:param accept: An optional function that can be used to quickly
|
||||||
reject images having another format.
|
reject images having another format.
|
||||||
"""
|
"""
|
||||||
|
global ID
|
||||||
|
|
||||||
id = id.upper()
|
id = id.upper()
|
||||||
ID.append(id)
|
ID.append(id)
|
||||||
OPEN[id] = factory, accept
|
OPEN[id] = factory, accept
|
||||||
|
|
Loading…
Reference in New Issue
Block a user