|
4 | 4 | from copy import copy
|
5 | 5 | from io import BytesIO
|
6 | 6 | from threading import Lock
|
7 |
| -from typing import TYPE_CHECKING, Dict, Tuple, Union |
| 7 | +from typing import TYPE_CHECKING, Dict, Optional, Tuple, Union |
8 | 8 |
|
9 | 9 | import astc_encoder
|
10 | 10 | import texture2ddecoder
|
@@ -165,7 +165,7 @@ def parse_image_data(
|
165 | 165 | texture_format: Union[int, TextureFormat],
|
166 | 166 | version: tuple,
|
167 | 167 | platform: int,
|
168 |
| - platform_blob: Union[bytes, None] = None, |
| 168 | + platform_blob: Optional[bytes] = None, |
169 | 169 | flip: bool = True,
|
170 | 170 | ) -> Image.Image:
|
171 | 171 | image_data = copy(bytes(image_data))
|
@@ -229,7 +229,7 @@ def pillow(
|
229 | 229 | mode: str,
|
230 | 230 | codec: str,
|
231 | 231 | args,
|
232 |
| - swap: Union[tuple, None] = None, |
| 232 | + swap: Optional[tuple] = None, |
233 | 233 | ) -> Image.Image:
|
234 | 234 | img = (
|
235 | 235 | Image.frombytes(mode, (width, height), image_data, codec, args)
|
@@ -334,7 +334,7 @@ def half(
|
334 | 334 | mode: str,
|
335 | 335 | codec: str,
|
336 | 336 | args,
|
337 |
| - swap: Union[tuple, None] = None, |
| 337 | + swap: Optional[tuple] = None, |
338 | 338 | ) -> Image.Image:
|
339 | 339 | # convert half-float to int8
|
340 | 340 | stream = BytesIO(image_data)
|
|
0 commit comments