执行 Ruff 安全自动修复
This commit is contained in:
+12
-12
@@ -21,14 +21,14 @@ import re
|
||||
import struct
|
||||
import time
|
||||
from collections import deque
|
||||
from typing import Any, Optional, Callable, cast
|
||||
from collections.abc import Callable
|
||||
from typing import Any, cast
|
||||
|
||||
import websockets
|
||||
|
||||
from .frame_decoder import _decode_taf_struct, _truncate, format_wss_log
|
||||
from .taf_protocol import TafInputStream, TafOutputStream, TafStruct, TafType
|
||||
from .wup_protocol import WupRequest, WupResponse
|
||||
from .taf_protocol import TafOutputStream, TafInputStream, TafType, TafStruct
|
||||
from .frame_decoder import format_wss_log, _decode_taf_struct, _truncate
|
||||
|
||||
|
||||
SHOP_WS_HOST = "77bc035c-ws.va.huya.com"
|
||||
# 商城端点 baseinfo (conn4, h5_/index.html) — 商城业务 shopMiddleUI 走此通道
|
||||
@@ -225,7 +225,7 @@ class HuyaWssClient:
|
||||
),
|
||||
timeout=timeout,
|
||||
)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
self.logger(f"[WSS] 连接超时({timeout}s)")
|
||||
raise
|
||||
except Exception as e:
|
||||
@@ -376,7 +376,7 @@ class HuyaWssClient:
|
||||
|
||||
try:
|
||||
body = await asyncio.wait_for(future, timeout)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
if future in self.rpc_queue:
|
||||
self.rpc_queue.remove(future)
|
||||
self.logger("[✗] wsLaunch 超时")
|
||||
@@ -526,7 +526,7 @@ class HuyaWssClient:
|
||||
|
||||
try:
|
||||
body = await asyncio.wait_for(future, timeout)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
if future in self.rpc_queue:
|
||||
self.rpc_queue.remove(future)
|
||||
self.logger("[✗] getConfig 超时")
|
||||
@@ -596,7 +596,7 @@ class HuyaWssClient:
|
||||
|
||||
try:
|
||||
body = await asyncio.wait_for(future, timeout)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
if future in self.rpc_queue:
|
||||
self.rpc_queue.remove(future)
|
||||
self.logger(f"[✗] {service}.{method} 超时")
|
||||
@@ -696,11 +696,11 @@ class HuyaWssClient:
|
||||
order_type: int = 6,
|
||||
):
|
||||
from .shop_structs import (
|
||||
CreateOrderReqV5,
|
||||
CreateOrderRsp,
|
||||
CreateOrderAccountParam,
|
||||
CreateOrderExtraParam,
|
||||
CreateOrderPromotionParam,
|
||||
CreateOrderAccountParam,
|
||||
CreateOrderReqV5,
|
||||
CreateOrderRsp,
|
||||
)
|
||||
|
||||
req = CreateOrderReqV5()
|
||||
@@ -781,7 +781,7 @@ class HuyaWssClient:
|
||||
|
||||
try:
|
||||
body = await asyncio.wait_for(future, 15.0)
|
||||
except asyncio.TimeoutError:
|
||||
except TimeoutError:
|
||||
if future in self.rpc_queue:
|
||||
self.rpc_queue.remove(future)
|
||||
self.logger("[✗] payOrderSubmitV5 超时")
|
||||
|
||||
Reference in New Issue
Block a user