adapt to new aiohttp_socks: fix deprecation warnings
...\electrum\electrum\util.py:1096: DeprecationWarning: SocksConnector is deprecated. Use ProxyConnector instead. connector = SocksConnector( ...\Python38\site-packages\aiohttp_socks\proxy\socks5_proxy.py:37: DeprecationWarning: Parameter family is deprecated and will be ignored. super().__init__(
This commit is contained in:
@@ -43,7 +43,7 @@ import ssl
|
||||
import ipaddress
|
||||
|
||||
import aiohttp
|
||||
from aiohttp_socks import SocksConnector, SocksVer
|
||||
from aiohttp_socks import ProxyConnector, ProxyType
|
||||
from aiorpcx import TaskGroup
|
||||
import certifi
|
||||
import dns.resolver
|
||||
@@ -1093,8 +1093,8 @@ def make_aiohttp_session(proxy: Optional[dict], headers=None, timeout=None):
|
||||
ssl_context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=ca_path)
|
||||
|
||||
if proxy:
|
||||
connector = SocksConnector(
|
||||
socks_ver=SocksVer.SOCKS5 if proxy['mode'] == 'socks5' else SocksVer.SOCKS4,
|
||||
connector = ProxyConnector(
|
||||
proxy_type=ProxyType.SOCKS5 if proxy['mode'] == 'socks5' else ProxyType.SOCKS4,
|
||||
host=proxy['host'],
|
||||
port=int(proxy['port']),
|
||||
username=proxy.get('user', None),
|
||||
|
||||
Reference in New Issue
Block a user