From 6d39a61a51249907dc209ec2bdf48e5fe2260ef2 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 30 Jul 2017 11:27:08 +0200 Subject: [PATCH] Shut down server on SIGINT on Windows select.select blocks SIGINT on Windows. --- radicale/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radicale/__main__.py b/radicale/__main__.py index cc9cc49..6541fc3 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -245,9 +245,9 @@ def serve(configuration, logger): if shutdown_program_socket_out: # Use socket pair to get notified of program shutdown sockets.append(shutdown_program_socket_out) - select_timeout = None - else: - # Fallback to busy waiting + select_timeout = None + if not shutdown_program_socket_out or os.name == "nt": + # Fallback to busy waiting. (select.select blocks SIGINT on Windows.) select_timeout = 1.0 if configuration.getboolean("server", "daemon"): daemonize(configuration, logger)