use ID as global variable

This commit is contained in:
albfan 2016-05-07 15:39:54 +02:00
parent f992192799
commit e23140f594

View File

@ -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