mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-06-10 17:35:57 +00:00
Fix 'make dev' failure in Windows environment (#3236)
* fix: Solving the problem of "make dev" failing to start in Windows environment * fix: revert the change to the startup_config and fix the lint errors * fix: Address Copilot review feedback - Validate wait-for-port input and avoid PowerShell port interpolation - Require Python 3 in serve.sh launcher detection - Keep Windows event loop policy setup in sitecustomize only - Clarify sitecustomize process-wide backend behavior
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"""Process-wide Python startup customizations for backend entrypoints.
|
||||
|
||||
When ``backend/`` is on ``sys.path``, Python imports this module during
|
||||
interpreter startup. Keep changes here suitable for all gateway, script,
|
||||
migration, and test entrypoints that run in that environment.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import sys
|
||||
|
||||
|
||||
def _configure_windows_event_loop_policy() -> None:
|
||||
if sys.platform != "win32":
|
||||
return
|
||||
|
||||
selector_policy = getattr(asyncio, "WindowsSelectorEventLoopPolicy", None)
|
||||
if selector_policy is None:
|
||||
return
|
||||
|
||||
if not isinstance(asyncio.get_event_loop_policy(), selector_policy):
|
||||
asyncio.set_event_loop_policy(selector_policy())
|
||||
|
||||
|
||||
_configure_windows_event_loop_policy()
|
||||
Reference in New Issue
Block a user