Skip to content

Commit 22c6425

Browse files
author
Robert Denham
committed
Simplify tqdm streamer without the cast
1 parent 4814d00 commit 22c6425

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

filesender/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, Iterable, List, Optional, Tuple, AsyncIterator, Union, cast
1+
from typing import Any, Iterable, List, Optional, Tuple, AsyncIterator, Union
22
from filesender.download import files_from_page, DownloadFile
33
import filesender.response_types as response
44
import filesender.request_types as request
@@ -334,7 +334,7 @@ async def _task_generator(chunk_size: int) -> AsyncIterator[Tuple[response.File,
334334
task_limit=self.concurrent_chunks
335335
)
336336
).stream() as streamer:
337-
async for _ in tqdm(cast(AsyncIterator[None], streamer), total=math.ceil(int(file_info["size"]) / self.chunk_size), desc=file_info["name"]):
337+
async for _ in tqdm(streamer, total=math.ceil(int(file_info["size"]) / self.chunk_size), desc=file_info["name"]):
338338
pass
339339

340340
async def _upload_chunk(

0 commit comments

Comments
 (0)