Skip to content

Commit 05b95c9

Browse files
committed
Prefer to use IO[bytes] to io.BytesIO when possible since it is more generic
1 parent a955ab0 commit 05b95c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Diff for: src/zimscraperlib/download.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
from __future__ import annotations
55

6-
import io
76
import pathlib
87
import subprocess
98
from concurrent.futures import Future, ThreadPoolExecutor
10-
from typing import ClassVar
9+
from typing import IO, ClassVar
1110

1211
import requests
1312
import yt_dlp as youtube_dl
@@ -174,7 +173,7 @@ def get_session(max_retries: int | None = 5) -> requests.Session:
174173
def stream_file(
175174
url: str,
176175
fpath: pathlib.Path | None = None,
177-
byte_stream: io.BytesIO | None = None,
176+
byte_stream: IO[bytes] | None = None,
178177
block_size: int | None = 1024,
179178
proxies: dict | None = None,
180179
only_first_block: bool | None = False, # noqa: FBT002

0 commit comments

Comments
 (0)