Skip to content

Commit 4127db8

Browse files
authored
fix: cli on windows (#520)
1 parent 910321d commit 4127db8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

roborock/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import functools
2828
import json
2929
import logging
30+
import sys
3031
import threading
3132
from collections.abc import Callable
3233
from dataclasses import asdict, dataclass
@@ -55,6 +56,9 @@
5556

5657
_LOGGER = logging.getLogger(__name__)
5758

59+
if sys.platform == "win32":
60+
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
61+
5862

5963
def dump_json(obj: Any) -> Any:
6064
"""Dump an object as JSON."""

0 commit comments

Comments
 (0)