summaryrefslogtreecommitdiff
path: root/searx/network
diff options
context:
space:
mode:
Diffstat (limited to 'searx/network')
-rw-r--r--searx/network/__init__.py6
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