Use snake_case

This commit is contained in:
Hugo 2018-09-29 19:34:03 +03:00 committed by Andrew Murray
parent 82d942c3d8
commit a0fda60662

View File

@ -2615,14 +2615,14 @@ def open(fp, mode="r"):
preinit() preinit()
acceptWarnings = [] accept_warnings = []
def _open_core(fp, filename, prefix): def _open_core(fp, filename, prefix):
for i in ID: for i in ID:
try: try:
factory, accept = OPEN[i] 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]:
acceptWarnings.append(result) accept_warnings.append(result)
elif result: elif result:
fp.seek(0) fp.seek(0)
im = factory(fp, filename) im = factory(fp, filename)
@ -2647,7 +2647,7 @@ def open(fp, mode="r"):
if exclusive_fp: if exclusive_fp:
fp.close() fp.close()
for message in acceptWarnings: for message in accept_warnings:
warnings.warn(message) warnings.warn(message)
raise IOError("cannot identify image file %r" raise IOError("cannot identify image file %r"
% (filename if filename else fp)) % (filename if filename else fp))