mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Assert false instead of raising an error
This commit is contained in:
parent
9a7a448219
commit
6d3c1985e0
|
@ -418,8 +418,7 @@ def test_plt_marker():
|
||||||
while True:
|
while True:
|
||||||
marker = out.read(2)
|
marker = out.read(2)
|
||||||
if not marker:
|
if not marker:
|
||||||
# End of steam encountered and no PLT or SOD
|
assert False, "End of stream without PLT"
|
||||||
break
|
|
||||||
|
|
||||||
jp2_boxid = _binary.i16be(marker)
|
jp2_boxid = _binary.i16be(marker)
|
||||||
if jp2_boxid == 0xFF4F:
|
if jp2_boxid == 0xFF4F:
|
||||||
|
@ -429,12 +428,8 @@ def test_plt_marker():
|
||||||
# PLT
|
# PLT
|
||||||
return
|
return
|
||||||
elif jp2_boxid == 0xFF93:
|
elif jp2_boxid == 0xFF93:
|
||||||
# SOD without finding PLT first
|
assert False, "SOD without finding PLT first"
|
||||||
break
|
|
||||||
|
|
||||||
hdr = out.read(2)
|
hdr = out.read(2)
|
||||||
length = _binary.i16be(hdr)
|
length = _binary.i16be(hdr)
|
||||||
out.seek(length - 2, os.SEEK_CUR)
|
out.seek(length - 2, os.SEEK_CUR)
|
||||||
|
|
||||||
# PLT wasn't found
|
|
||||||
raise ValueError
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user