完成 Ruff 全量清理
This commit is contained in:
@@ -6,7 +6,7 @@ import threading
|
||||
import time
|
||||
from collections.abc import Mapping
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from core.sms_provider import SmsLine, SmsProviderClient
|
||||
|
||||
@@ -76,7 +76,7 @@ def register_huya_with_sms_line(
|
||||
sms_url=item.url,
|
||||
)
|
||||
|
||||
sent_at = datetime.now()
|
||||
sent_at = datetime.now(UTC)
|
||||
try:
|
||||
code_result = send_huya_sms_code(phone=phone, proxies=proxies)
|
||||
except HuyaLoginError as exc:
|
||||
@@ -89,7 +89,7 @@ def register_huya_with_sms_line(
|
||||
normalized_phone=normalized_phone,
|
||||
sms_url=item.url,
|
||||
)
|
||||
except Exception as exc:
|
||||
except Exception as exc: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
return HuyaAutoRegisterResult(
|
||||
phone=phone,
|
||||
provider=item.provider,
|
||||
@@ -155,7 +155,7 @@ def register_huya_with_sms_line(
|
||||
sms_url=item.url,
|
||||
attempts=attempts,
|
||||
)
|
||||
except Exception as exc:
|
||||
except Exception as exc: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
return HuyaAutoRegisterResult(
|
||||
phone=phone,
|
||||
provider=item.provider,
|
||||
|
||||
Reference in New Issue
Block a user