完成 Ruff 全量清理

This commit is contained in:
yml2213
2026-08-31 10:55:44 +08:00
parent 840af3108e
commit 09ab80e062
68 changed files with 323 additions and 291 deletions
+5 -5
View File
@@ -135,7 +135,7 @@ class XpdMixin:
result["before_role_name"] = str(before.get("role_name") or "")
result["before_area_name"] = str(before.get("area_name") or "")
result["before_plat_name"] = str(before.get("plat_name") or "")
except Exception:
except Exception: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
result["before_bound"] = False
result["before_role_name"] = ""
result["bind_polling"] = True
@@ -208,7 +208,7 @@ class XpdMixin:
f"等待扫码绑定(第 {poll_count} 次)",
result,
)
except Exception as exc:
except Exception as exc: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
poll_count += 1
result["bind_poll_count"] = poll_count
result["bind_poll_error"] = str(exc)
@@ -259,7 +259,7 @@ class XpdMixin:
else:
account.xpd_game_name = role_name
account.updated_at = datetime.now(UTC)
except Exception:
except Exception: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
account.xpd_game_name = role_name
account.updated_at = datetime.now(UTC)
account.xpd_bind_status = "xpd_bound"
@@ -409,8 +409,8 @@ class XpdMixin:
plat = str(role_plat) if role_plat not in (None, "") else plat
areaid = str(role_area) or areaid
self._apply_xpd_role_to_account(account, role, role_area)
except Exception:
pass
except Exception as exc: # noqa: BLE001
self._push_log("debug", f"小店角色信息补全失败: {exc}")
if not openid or not roleid:
self._mark_task(
db, task, "failed", "未获取到小店绑定角色,请先生成二维码扫码绑定"