diff --git a/freqtrade/commands/strategy_utils_commands.py b/freqtrade/commands/strategy_utils_commands.py index aca368742..ed4d0bf1a 100644 --- a/freqtrade/commands/strategy_utils_commands.py +++ b/freqtrade/commands/strategy_utils_commands.py @@ -1,4 +1,5 @@ import logging +import sys import time from pathlib import Path from typing import Any, Dict @@ -19,6 +20,9 @@ def start_strategy_update(args: Dict[str, Any]) -> None: :return: None """ + if sys.version_info == (3, 8): # pragma: no cover + sys.exit("Freqtrade strategy updater requires Python version >= 3.9") + config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE) strategy_objs = StrategyResolver.search_all_objects( diff --git a/tests/test_strategy_updater.py b/tests/test_strategy_updater.py index 927c5e99f..ea971af72 100644 --- a/tests/test_strategy_updater.py +++ b/tests/test_strategy_updater.py @@ -1,8 +1,16 @@ # pragma pylint: disable=missing-docstring, protected-access, invalid-name +import sys + +import pytest + from freqtrade.strategy.strategyupdater import StrategyUpdater +if sys.version_info < (3, 9): + pytest.skip("StrategyUpdater is not compatible with Python 3.8", allow_module_level=True) + + def test_strategy_updater(default_conf, caplog) -> None: instance_strategy_updater = StrategyUpdater() modified_code1 = instance_strategy_updater.update_code("""