From 196c3c779a89457816acdfc7f914ce08fdf62a13 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sun, 17 Nov 2019 16:58:35 +0100 Subject: [PATCH] Fix sby execution on Windows --- sbysrc/sby_core.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sbysrc/sby_core.py b/sbysrc/sby_core.py index 98f4032..b01dc1e 100644 --- a/sbysrc/sby_core.py +++ b/sbysrc/sby_core.py @@ -34,8 +34,8 @@ def force_shutdown(signum, frame): if os.name == "posix": signal.signal(signal.SIGHUP, force_shutdown) -signal.signal(signal.SIGINT, force_shutdown) -signal.signal(signal.SIGTERM, force_shutdown) + signal.signal(signal.SIGINT, force_shutdown) + signal.signal(signal.SIGTERM, force_shutdown) def process_filename(filename): if filename.startswith("~/"): @@ -242,10 +242,11 @@ class SbyJob: if task.running: fds.append(task.p.stdout) - try: - select(fds, [], [], 1.0) == ([], [], []) - except InterruptedError: - pass + if os.name == "posix": + try: + select(fds, [], [], 1.0) == ([], [], []) + except InterruptedError: + pass for task in self.tasks_running: task.poll() -- 2.30.2