From 52b0078f2ce61fca1266441f3b1f789db6cf807f Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Thu, 17 Aug 2023 15:34:38 -0700 Subject: [PATCH] Use default event loop on Windows in Python 3.8 (#574) In Python 3.8 and newer, the default event loop on Windows is the ProactorEventLoop, so there's no reason to specifically create one here. We can drop this conditional entirely when we drop Python 3.7 support. --- colcon_core/subprocess.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/colcon_core/subprocess.py b/colcon_core/subprocess.py index 05576cb5..2786c19f 100644 --- a/colcon_core/subprocess.py +++ b/colcon_core/subprocess.py @@ -37,7 +37,8 @@ def new_event_loop(): :returns: The created event loop """ - if sys.platform == 'win32': + # TODO: Drop this along with py3.7 + if sys.platform == 'win32' and sys.version_info < (3, 8): return asyncio.ProactorEventLoop() return asyncio.new_event_loop()