mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 17:30:23 +08:00
fix: 添加 from __future__ import annotations 修复运行时类型错误
原 PR 将 Optional[X] 改为 X | None 后,如果 X 在 TYPE_CHECKING 块中导入, 会导致运行时 NameError。添加 future annotations 使类型注解延迟求值。 影响文件: - src/services/auth/service.py - src/core/api_format/utils.py - src/core/api_format/detection.py - 及其他 15 个使用 TYPE_CHECKING 的文件
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
) -> JSONResponse: ...
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
import asyncio
|
||||
import time
|
||||
|
||||
@@ -10,6 +10,8 @@ CLI Message Handler 通用基类
|
||||
3. 简化新格式接入 - 只需实现 ResponseParser 和少量钩子方法
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import codecs
|
||||
import json
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
- 请求/响应数据
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import time
|
||||
from dataclasses import dataclass, field
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
Handler 基础工具函数
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
import json
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
Reference in New Issue
Block a user