Skip to content

Commit 859b742

Browse files
isHarryhK0lb3
authored andcommitted
fix: type hint use Optional
1 parent 2d3d2c2 commit 859b742

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

UnityPy/export/Texture2DConverter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from copy import copy
55
from io import BytesIO
66
from threading import Lock
7-
from typing import TYPE_CHECKING, Dict, Tuple, Union
7+
from typing import TYPE_CHECKING, Dict, Optional, Tuple, Union
88

99
import astc_encoder
1010
import texture2ddecoder
@@ -165,7 +165,7 @@ def parse_image_data(
165165
texture_format: Union[int, TextureFormat],
166166
version: tuple,
167167
platform: int,
168-
platform_blob: Union[bytes, None] = None,
168+
platform_blob: Optional[bytes] = None,
169169
flip: bool = True,
170170
) -> Image.Image:
171171
image_data = copy(bytes(image_data))
@@ -229,7 +229,7 @@ def pillow(
229229
mode: str,
230230
codec: str,
231231
args,
232-
swap: Union[tuple, None] = None,
232+
swap: Optional[tuple] = None,
233233
) -> Image.Image:
234234
img = (
235235
Image.frombytes(mode, (width, height), image_data, codec, args)
@@ -334,7 +334,7 @@ def half(
334334
mode: str,
335335
codec: str,
336336
args,
337-
swap: Union[tuple, None] = None,
337+
swap: Optional[tuple] = None,
338338
) -> Image.Image:
339339
# convert half-float to int8
340340
stream = BytesIO(image_data)

0 commit comments

Comments
 (0)