From 7db209f8a0222fa3a28ac29b37ff960dcbce5837 Mon Sep 17 00:00:00 2001 From: Andrei Boca Date: Tue, 22 Aug 2023 17:34:53 +0200 Subject: [PATCH] fix(startup.py): add custom loop policy for Windows --- startup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/startup.py b/startup.py index f37b5286c..03b2149c4 100644 --- a/startup.py +++ b/startup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio - +import platform import fire from metagpt.roles import Architect, Engineer, ProductManager, ProjectManager, QaEngineer @@ -33,6 +33,8 @@ def main(idea: str, investment: float = 3.0, n_round: int = 5, code_review: bool :param code_review: Whether to use code review. :return: """ + if platform.system() == "Windows": + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(startup(idea, investment, n_round, code_review, run_tests))