Skip to content

Commit 99b9dbb

Browse files
author
Your Name
committed
Make sure SelectorEventLoop actually exists on asyncio
1 parent 738b433 commit 99b9dbb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cecli/run_cmd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ async def run_cmd_async(
134134

135135
if platform.system() == "Windows":
136136
loop = asyncio.get_running_loop()
137-
if not isinstance(loop, asyncio.SelectorEventLoop):
137+
if hasattr(asyncio, "SelectorEventLoop") and not isinstance(
138+
loop, asyncio.SelectorEventLoop
139+
):
138140
# Fallback to synchronous version if not using SelectorEventLoop
139141
return await loop.run_in_executor(
140142
None,

0 commit comments

Comments
 (0)