From 68d1bbcd6106e4ea8f04c9df8d6d6ede4a98e1bd Mon Sep 17 00:00:00 2001 From: tazlin Date: Wed, 31 Jul 2024 09:54:45 -0400 Subject: [PATCH] fix: set `WindowsSelectorEventLoopPolicy` on `win32` I am unclear on the exact package causing this issue but my guess is that the call (`asyncio.set_event_loop_policy(...)`) either was previously happening elsewhere or is now being overridden somehow in the latest version of a package. The error that occurs without this fix directs you to https://github.com/saghul/aiodns/issues/86 which indicated the fix used in this commit. --- horde_worker_regen/run_worker.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/horde_worker_regen/run_worker.py b/horde_worker_regen/run_worker.py index d0da103b..3e1a9ea5 100644 --- a/horde_worker_regen/run_worker.py +++ b/horde_worker_regen/run_worker.py @@ -1,11 +1,17 @@ """The main entry point for the reGen worker.""" +import sys + +if sys.platform == "win32": + import asyncio + + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + import argparse import contextlib import io import multiprocessing import os -import sys import time from multiprocessing.context import BaseContext