diff --git a/src/easy_tdx/screen/scanner.py b/src/easy_tdx/screen/scanner.py index 5209403..61d1154 100644 --- a/src/easy_tdx/screen/scanner.py +++ b/src/easy_tdx/screen/scanner.py @@ -536,14 +536,14 @@ def _get_strategy_file(strategy_cls: type) -> str: for attr_name in ("init", "next", "on_bar", "on_tick"): method = strategy_cls.__dict__.get(attr_name) if method is not None and hasattr(method, "__code__"): - filepath: str = method.__code__.co_filename # type: ignore[assignment] + filepath: str = method.__code__.co_filename if filepath and not filepath.startswith("<"): return filepath # 3. 任意自定义方法 for attr_val in strategy_cls.__dict__.values(): if callable(attr_val) and hasattr(attr_val, "__code__"): - filepath2: str = attr_val.__code__.co_filename # type: ignore[assignment] + filepath2: str = attr_val.__code__.co_filename if filepath2 and not filepath2.startswith("<"): return filepath2