Skip to content

Commit b642829

Browse files
committed
pil_codec - fix decoder typing issue
1 parent a0ab8f5 commit b642829

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: astc_encoder/pil_codec.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
import struct
7-
from typing import Any, List
7+
from typing import Any, List, Union
88

99
from PIL import Image, ImageFile
1010

@@ -100,7 +100,9 @@ def init(self, args: List[Any]): # noqa: D102
100100
)
101101
self.context = ASTCContext(config)
102102

103-
def decode(self, buffer: bytes | Image.SupportsArrayInterface) -> tuple[int, int]: # noqa: D102
103+
def decode(
104+
self, buffer: Union[bytes, Image.SupportsArrayInterface]
105+
) -> tuple[int, int]: # noqa: D102
104106
assert self.state.xoff == 0 and self.state.yoff == 0, "Cannot handle offsets"
105107

106108
config = self.context.config

0 commit comments

Comments
 (0)