Skip to content

Commit cde1b97

Browse files
author
Codemation
committed
Cleaned up exception usage in aiohttp
1 parent 6f1b480 commit cde1b97

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

easyrpc/proxy.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
import asyncio
55
from traceback import format_exc
66
from concurrent.futures._base import CancelledError
7-
from aiohttp._websocket.models import WSMessage, WSMsgType
87

9-
from aiohttp import ClientSession
10-
import aiohttp
8+
from aiohttp import ClientSession, WSMessage, WSMsgType
9+
from aiohttp.client_exceptions import ClientConnectorError
1110

1211
from easyrpc.register import (
1312
create_proxy_from_config,
@@ -526,7 +525,7 @@ async def keep_alive():
526525
self.namespaces = {}
527526
except Exception as e:
528527
if type(e) in {
529-
aiohttp.client_exceptions.ClientConnectorError,
528+
ClientConnectorError,
530529
ConnectionRefusedError
531530
}:
532531
connection_error = ServerUnreachable(

0 commit comments

Comments
 (0)