Skip to content

Commit

Permalink
chore: workaround python/mypy#4177
Browse files Browse the repository at this point in the history
  • Loading branch information
desbma committed Aug 13, 2023
1 parent 43ca52f commit 25ec058
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sacad/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ async def pre_cache_callback(img_data):
return await __class__.crunch(img_data, self.format)

store_in_cache_callback, image_data = await self.source.http.query(
url, headers=headers, verify=False, cache=__class__.image_cache, pre_cache_callback=pre_cache_callback
url,
headers=headers,
verify=False,
cache=__class__.image_cache, # type: ignore
pre_cache_callback=pre_cache_callback,
)

# store immediately in cache
Expand All @@ -205,7 +209,7 @@ async def pre_cache_callback(img_data):
need_join = len(images_data) > 1
need_post_process = (need_format_change and (not preserve_format)) or need_join or need_size_change
need_post_process = need_post_process or (
__class__.isProgressiveJpegData(images_data[0]) and convert_progressive_jpeg
__class__.isProgressiveJpegData(images_data[0]) and convert_progressive_jpeg # type: ignore
)
if need_post_process:
# post process
Expand All @@ -214,7 +218,7 @@ async def pre_cache_callback(img_data):
)

# crunch image again
image_data = await __class__.crunch(image_data, target_format)
image_data = await __class__.crunch(image_data, target_format) # type: ignore

format_changed = need_format_change
else:
Expand Down

0 comments on commit 25ec058

Please sign in to comment.