diff options
author | Alexandre Flament <alex@al-f.net> | 2021-09-28 17:44:00 +0200 |
---|---|---|
committer | Alexandre Flament <alex@al-f.net> | 2021-09-28 19:33:29 +0200 |
commit | a9c3c88cc0edf4dc3183f2188c518ec4a5b37055 (patch) | |
tree | c7bbf4817ecaab06f24ecfd6d6b6cb19c2454da7 /searx/network/__init__.py | |
parent | c23aa5760cb42003c1372ccdef1611695504eb9e (diff) | |
download | searxng-a9c3c88cc0edf4dc3183f2188c518ec4a5b37055.tar.gz searxng-a9c3c88cc0edf4dc3183f2188c518ec4a5b37055.zip |
[mod] searx.network.stream returns a tuple (response, stream)
Diffstat (limited to 'searx/network/__init__.py')
-rw-r--r-- | searx/network/__init__.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/searx/network/__init__.py b/searx/network/__init__.py index 37df0c85a..496fd2fbf 100644 --- a/searx/network/__init__.py +++ b/searx/network/__init__.py @@ -219,8 +219,7 @@ def stream(method, url, **kwargs): """Replace httpx.stream. Usage: - stream = poolrequests.stream(...) - response = next(stream) + response, stream = poolrequests.stream(...) for chunk in stream: ... @@ -236,6 +235,5 @@ def stream(method, url, **kwargs): response._generator = generator # pylint: disable=protected-access response.close = MethodType(_close_response_method, response) - yield response - yield from generator + return response, generator |