Skip to content

Commit 7b356f2

Browse files
committed
Added correct policy-match for python versions.
1 parent c3a3422 commit 7b356f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

run.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ async def run_node(name, config_dir=None, no_autoupdate=False) -> int:
241241
if sys.platform == 'win32':
242242
# disable quick edit mode (thanks to Moots)
243243
utils.quick_edit_mode(False)
244+
if sys.version_info < (3, 14):
245+
# set the asyncio event loop policy
246+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
244247

245248
# get the command line args from core
246249
args = COMMAND_LINE_ARGS
@@ -275,7 +278,7 @@ async def run_node(name, config_dir=None, no_autoupdate=False) -> int:
275278

276279
with PidFile(pidname=f"dcssb_{args.node}", piddir='.'):
277280
try:
278-
if sys.platform == "win32":
281+
if sys.platform == "win32" and sys.version_info >= (3, 12):
279282
import selectors
280283

281284
rc = asyncio.run(
@@ -288,7 +291,7 @@ async def run_node(name, config_dir=None, no_autoupdate=False) -> int:
288291
from install import Install
289292

290293
Install(node=args.node).install(config_dir=args.config, user='dcsserverbot', database='dcsserverbot')
291-
if sys.platform == "win32":
294+
if sys.platform == "win32" and sys.version_info >= (3, 12):
292295
import selectors
293296

294297
rc = asyncio.run(

0 commit comments

Comments
 (0)