|
2 | 2 | from typing import Union, Optional, AnyStr
|
3 | 3 | from typing_extensions import Final
|
4 | 4 | from collections.abc import Callable
|
5 |
| -from .compat import nullcontext, ssl_create_default_context |
| 5 | +from .compat import nullcontext, ssl_create_default_context, AiohttpUvloopTransportHotfix |
6 | 6 |
|
7 | 7 | import re
|
8 | 8 | import asyncio
|
@@ -225,15 +225,16 @@ async def _fetch():
|
225 | 225 | async with aiohttp.ClientSession(connector=proxy_connector, timeout=aiohttp.ClientTimeout(total=timeout),
|
226 | 226 | headers=_headers) as session:
|
227 | 227 | async with session.get(url, read_bufsize=read_bufsize, read_until_eof=read_until_eof) as response:
|
228 |
| - status = response.status |
229 |
| - content = None |
230 |
| - if status == 200: |
231 |
| - content = await resp_callback(response) |
232 |
| - return WebResponse(url=url, |
233 |
| - content=content, |
234 |
| - headers=response.headers, |
235 |
| - status=status, |
236 |
| - reason=response.reason) |
| 228 | + async with AiohttpUvloopTransportHotfix(response): |
| 229 | + status = response.status |
| 230 | + content = None |
| 231 | + if status == 200: |
| 232 | + content = await resp_callback(response) |
| 233 | + return WebResponse(url=url, |
| 234 | + content=content, |
| 235 | + headers=response.headers, |
| 236 | + status=status, |
| 237 | + reason=response.reason) |
237 | 238 |
|
238 | 239 | tries = 0
|
239 | 240 | retry_in_v4_flag = False
|
|
0 commit comments