完成 Ruff 全量清理
This commit is contained in:
@@ -38,13 +38,13 @@ def get_official_orders(cookies: dict[str, str], count: int = 20) -> dict[str, A
|
||||
except ValueError as exc:
|
||||
raise RuntimeError("订单状态查询返回非 JSON") from exc
|
||||
if not isinstance(document, dict):
|
||||
raise RuntimeError("订单状态查询响应格式异常")
|
||||
raise TypeError("订单状态查询响应格式异常")
|
||||
if document.get("ret_code") not in (None, 0, "0"):
|
||||
raise RuntimeError(
|
||||
f"订单状态查询失败: {document.get('ret_code')} {document.get('ret_msg', '')}"
|
||||
)
|
||||
if not isinstance(document.get("list", []), list):
|
||||
raise RuntimeError("订单状态查询响应缺少 list")
|
||||
raise TypeError("订单状态查询响应缺少 list")
|
||||
return document
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user