fix(reservation): 补 _RESERVATION_ERROR_UTILS_AVAILABLE import 修复运行时 NameError
attend_window.py 中 9 处使用 _RESERVATION_ERROR_UTILS_AVAILABLE 标志, 但 import 语句只导入了 ReservationItem / format_reservation_context / log_reservation_error / safe_write_state,没有导入这个标志。 发现路径:尝试为该文件提取 helper 时,stub 测试触发到第 360 行的 "future_ts 无效"分支,立即抛出 NameError。 原代码中此分支被 try/except 覆盖的概率较高(外层 try 会吞噬), 但只要执行流落在 line 64/95/113/167/296/360/371/...(共 9 处) 任意一个 if 判断上,就会 NameError。 修复:把 _RESERVATION_ERROR_UTILS_AVAILABLE 加入 ._common 的 import 列表。 验证: - stub 测试通过 - pytest 1013 passed Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
d7201866a5
commit
3b600c9f64
1 file changed
+1
@@ -11,6 +11,7 @@ from typing import Any, Callable, Dict, List, Optional
|
||||
|
||||
from ._common import (
|
||||
ReservationItem,
|
||||
_RESERVATION_ERROR_UTILS_AVAILABLE,
|
||||
format_reservation_context,
|
||||
log_reservation_error,
|
||||
safe_write_state,
|
||||
|
||||
Reference in new issue
Block a user