fix: compatible with Python 3.7 by deferring Literal import in truncate.py

This commit is contained in:
zhayujie
2026-04-15 12:29:09 +08:00
parent 3830f76729
commit d4e5ecd497

View File

@@ -8,7 +8,10 @@ Truncation is based on two independent limits - whichever is hit first wins:
Never returns partial lines (except bash tail truncation edge case).
"""
from typing import Dict, Any, Optional, Literal, Tuple
from __future__ import annotations
from typing import Dict, Any, Optional, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from typing import Literal
DEFAULT_MAX_LINES = 2000