chore: set asyncio-policy for windows

This commit is contained in:
Matthias 2024-08-08 20:20:14 +02:00
parent f6040c5f06
commit d4ca6617de
3 changed files with 12 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# flake8: noqa: F401
from freqtrade.configuration.asyncio_config import asyncio_setup
from freqtrade.configuration.config_secrets import sanitize_config
from freqtrade.configuration.config_setup import setup_utils_configuration
from freqtrade.configuration.config_validation import validate_config_consistency

View File

@ -0,0 +1,9 @@
import asyncio
import sys
def asyncio_setup() -> None:
# Set eventloop for win32 setups
if sys.platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy)

View File

@ -15,6 +15,7 @@ if sys.version_info < (3, 9): # pragma: no cover
from freqtrade import __version__
from freqtrade.commands import Arguments
from freqtrade.configuration import asyncio_setup
from freqtrade.constants import DOCS_LINK
from freqtrade.exceptions import ConfigurationError, FreqtradeException, OperationalException
from freqtrade.loggers import setup_logging_pre
@ -33,6 +34,7 @@ def main(sysargv: Optional[List[str]] = None) -> None:
return_code: Any = 1
try:
setup_logging_pre()
asyncio_setup()
arguments = Arguments(sysargv)
args = arguments.get_parsed_arg()