conftest fixed

This commit is contained in:
Deekshu Kare 2024-06-27 03:18:35 +02:00
parent fdcb04ca81
commit d73ce6aa55
2 changed files with 13 additions and 10 deletions

View File

@ -40,6 +40,11 @@ from typing import IO
from . import Image, ImageFile
branches = {
"1": False,
"2": False,
}
class Format(IntEnum):
JPEG = 0
@ -276,22 +281,20 @@ class BlpImageFile(ImageFile.ImageFile):
class _BLPBaseDecoder(ImageFile.PyDecoder):
branches = {
"1": False,
"2": False,
}
_pulls_fd = True
def decode(self, buffer: bytes) -> tuple[int, int]:
branches = {
"1": False,
"2": False,
}
try:
branches["1"] = True;
branches["1"] = True
self._read_blp_header()
self._load()
except struct.error as e:
branches["2"] = True;
branches["2"] = True
msg = "Truncated BLP file"
raise OSError(msg) from e
return -1, 0

View File

@ -48,11 +48,11 @@ def read_32t(fobj, start_length, size):
fobj.seek(start)
sig = fobj.read(4)
if sig != b"\x00\x00\x00\x00":
branches["1"] = True;
branches["1"] = True
msg = "Unknown signature, expecting 0x00000000"
raise SyntaxError(msg)
else:
branches["2"] = True;
branches["2"] = True
return read_32(fobj, (start + 4, length - 4), size)