From 9a2cfac637cd52ec5665c45d88ada5bf1ebddf66 Mon Sep 17 00:00:00 2001 From: Christoph Stahl Date: Tue, 1 Oct 2024 12:32:11 +0200 Subject: [PATCH] Added initial windows support --- syng/client.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/syng/client.py b/syng/client.py index fe89cd4..19dc799 100644 --- a/syng/client.py +++ b/syng/client.py @@ -13,6 +13,7 @@ be one of: """ from __future__ import annotations +import os import asyncio import datetime from logging import LogRecord @@ -443,8 +444,10 @@ async def start_client(config: dict[str, Any]) -> None: await sio.connect(state.config["server"]) - asyncio.get_event_loop().add_signal_handler(signal.SIGINT, signal_handler) - asyncio.get_event_loop().add_signal_handler(signal.SIGTERM, signal_handler) + # this is not supported under windows + if os.name != "nt": + asyncio.get_event_loop().add_signal_handler(signal.SIGINT, signal_handler) + asyncio.get_event_loop().add_signal_handler(signal.SIGTERM, signal_handler) try: await sio.wait()