From 65c53df5b3af5bb5bfd925fa333dc7e627964bd0 Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 7 May 2017 21:55:59 +0200 Subject: [PATCH] Keep original exception when PID file creation fails --- radicale/__main__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/radicale/__main__.py b/radicale/__main__.py index e3afe3c4..70bf762f 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -123,9 +123,9 @@ def daemonize(configuration, logger): pid_fd = os.open( configuration.get("server", "pid"), os.O_CREAT | os.O_EXCL | os.O_WRONLY) - except: - raise OSError( - "PID file exists: %s" % configuration.get("server", "pid")) + except OSError as e: + raise OSError("PID file exists: %s" % + configuration.get("server", "pid")) from e pid = os.fork() if pid: sys.exit()