mypy fixes

This commit is contained in:
Timothy Pogue
2022-09-06 12:40:58 -06:00
parent 3535aa7724
commit b1c0267449
4 changed files with 16 additions and 7 deletions

View File

@@ -3,6 +3,8 @@ from threading import RLock
from typing import List, Optional, Type
from uuid import uuid4
from fastapi import WebSocket as FastAPIWebSocket
from freqtrade.rpc.api_server.ws.proxy import WebSocketProxy
from freqtrade.rpc.api_server.ws.serializer import (HybridJSONWebSocketSerializer,
WebSocketSerializer)
@@ -105,7 +107,7 @@ class ChannelManager:
:param websocket: The WebSocket object to attach to the Channel
"""
if hasattr(websocket, "accept"):
if isinstance(websocket, FastAPIWebSocket):
try:
await websocket.accept()
except RuntimeError: