Skip to content

Commit 018a1fa

Browse files
authored
Merge pull request #105 from openzim/fix_issue_104
Fix return type since it is a Tuple and not a Union
2 parents 36ae903 + 200d6c2 commit 018a1fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/zimscraperlib/download.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# -*- coding: utf-8 -*-
33
# vim: ai ts=4 sts=4 et sw=4 nu
44

5+
from __future__ import annotations
6+
57
import io
68
import pathlib
79
import subprocess
@@ -174,7 +176,7 @@ def stream_file(
174176
max_retries: Optional[int] = 5,
175177
headers: Optional[Dict[str, str]] = None,
176178
session: Optional[requests.Session] = None,
177-
) -> Union[int, requests.structures.CaseInsensitiveDict]:
179+
) -> tuple[int, requests.structures.CaseInsensitiveDict]:
178180
"""Stream data from a URL to either a BytesIO object or a file
179181
Arguments -
180182
fpath - Path of the file where data is sent

0 commit comments

Comments
 (0)