Merge branch 'dev' into fix/block-ads-unexpected-kwarg

This commit is contained in:
Karim shoair
2026-04-17 20:45:00 +02:00
committed by GitHub
23 changed files with 607 additions and 220 deletions
+12 -2
View File
@@ -719,8 +719,13 @@ class FetcherSession:
config["selector_config"] = self.selector_config
config["proxy_rotator"] = self._proxy_rotator
self._client = _SyncSessionLogic(**config)
try:
result = self._client.__enter__()
except Exception:
self._client = None
raise
self._is_alive = True
return self._client.__enter__()
return result
raise RuntimeError("This FetcherSession instance already has an active synchronous session.")
def __exit__(self, exc_type, exc_val, exc_tb):
@@ -740,8 +745,13 @@ class FetcherSession:
config["selector_config"] = self.selector_config
config["proxy_rotator"] = self._proxy_rotator
self._client = _ASyncSessionLogic(**config)
try:
result = await self._client.__aenter__()
except Exception:
self._client = None
raise
self._is_alive = True
return await self._client.__aenter__()
return result
raise RuntimeError("This FetcherSession instance already has an active asynchronous session.")
async def __aexit__(self, exc_type, exc_val, exc_tb):