Skip to content

Commit

Permalink
Fix incompatibility with python3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Mar 21, 2024
1 parent a712bb5 commit 1d5be62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/sticker_convert/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,11 +453,11 @@ def _frames_import_pyav(self) -> None:

yuv_array = yuv_array.astype(np.float32)
yuv_array[:, :, 0] = (
yuv_array[:, :, 0].clip(16, 235).astype(yuv_array.dtype)
yuv_array[:, :, 0].clip(16, 235).astype(yuv_array.dtype) # type: ignore
- 16
)
yuv_array[:, :, 1:] = (
yuv_array[:, :, 1:].clip(16, 240).astype(yuv_array.dtype)
yuv_array[:, :, 1:].clip(16, 240).astype(yuv_array.dtype) # type: ignore
- 128
)

Expand Down
7 changes: 3 additions & 4 deletions src/sticker_convert/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from sticker_convert.utils.files.metadata_handler import MetadataHandler
from sticker_convert.utils.media.codec_info import CodecInfo

CbQueueType = Queue[CbQueueItemType]
WorkListItemType = Optional[Tuple[Callable[..., Any], Tuple[Any, ...]]]
if TYPE_CHECKING:
# mypy complains about this
Expand Down Expand Up @@ -59,7 +58,7 @@ def __init__(
# Especially when using scale_filter=nearest
self.work_list: WorkListType = self.manager.list()
self.results_queue: Queue[Any] = self.manager.Queue()
self.cb_queue: CbQueueType = self.manager.Queue()
self.cb_queue: Queue[CbQueueItemType] = self.manager.Queue()
self.cb_return = CallbackReturn()
self.processes: List[Process] = []

Expand All @@ -76,7 +75,7 @@ def __init__(

def cb_thread(
self,
cb_queue: CbQueueType,
cb_queue: Queue[CbQueueItemType],
cb_return: CallbackReturn,
) -> None:
for i in iter(cb_queue.get, None):
Expand Down Expand Up @@ -113,7 +112,7 @@ def cb_thread(
def worker(
work_list: WorkListType,
results_queue: Queue[Any],
cb_queue: CbQueueType,
cb_queue: Queue[CbQueueItemType],
cb_return: CallbackReturn,
) -> None:
while True:
Expand Down

0 comments on commit 1d5be62

Please sign in to comment.