From 6ba0de29a5192162f92dc9e43a67267ecd1cf43b Mon Sep 17 00:00:00 2001 From: Dolph Mathews Date: Mon, 12 Oct 2015 19:24:17 +0000 Subject: [PATCH] Explicitly handle ImportError for pid_file_module Change-Id: Ide9f386a1819b5111d54a75231ff996179f43ecb --- statusbot/bot.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/statusbot/bot.py b/statusbot/bot.py index fc73b6b..1ffd071 100644 --- a/statusbot/bot.py +++ b/statusbot/bot.py @@ -52,13 +52,11 @@ import ssl import urllib try: - import daemon.pidlockfile - pid_file_module = daemon.pidlockfile -except: + import daemon.pidlockfile as pid_file_module +except ImportError: # as of python-daemon 1.6 it doesn't bundle pidlockfile anymore # instead it depends on lockfile-0.9.1 - import daemon.pidfile - pid_file_module = daemon.pidfile + import daemon.pidfile as pid_file_module # https://bitbucket.org/jaraco/irc/issue/34/