chore: ruff 代码检查与修复
130 issues auto-fixed (import ordering, UP045/UP006 type annotations), 33 issues manually fixed (E712/E501/E402/E722 + N818 rename + per-file wechat ignore for N8xx naming conventions). All 33 tests pass.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import time
|
||||
|
||||
import httpx
|
||||
from typing import Optional
|
||||
|
||||
from app.config import settings
|
||||
|
||||
|
||||
class WeChatClient:
|
||||
def __init__(self):
|
||||
self._access_token: Optional[str] = None
|
||||
self._access_token: str | None = None
|
||||
self._token_expires_at: float = 0
|
||||
|
||||
async def _get_access_token(self) -> Optional[str]:
|
||||
async def _get_access_token(self) -> str | None:
|
||||
now = time.time()
|
||||
if self._access_token and now < self._token_expires_at:
|
||||
return self._access_token
|
||||
|
||||
Reference in New Issue
Block a user