From ea97c014b7e03d8cb2dd094f7f800f68e2ee4133 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Mon, 3 Nov 2014 11:21:12 +0100 Subject: [PATCH] Don't crash because of missing SIGHUP on Windows Fix #229. --- radicale/log.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/radicale/log.py b/radicale/log.py index 5ca336c..18c4de5 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -52,10 +52,11 @@ def start(): if os.path.exists(filename): # Configuration taken from file configure_from_file(filename, debug) - # Reload config on SIGHUP - def handler(signum, frame): - configure_from_file(filename, debug) - signal.signal(signal.SIGHUP, handler) + # Reload config on SIGHUP (UNIX only) + if hasattr(signal, 'SIGHUP'): + def handler(signum, frame): + configure_from_file(filename, debug) + signal.signal(signal.SIGHUP, handler) else: # Default configuration, standard output handler = logging.StreamHandler(sys.stdout)