From 98ffcd8e05a6965381af15a99e29a6eaf46f1e36 Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Tue, 15 Nov 2011 00:35:56 +0100 Subject: [PATCH] Create soft dependency on logbook. --- rq/daemon.py | 5 ++++- rq/worker.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rq/daemon.py b/rq/daemon.py index 2c888a4..f891b63 100644 --- a/rq/daemon.py +++ b/rq/daemon.py @@ -1,4 +1,7 @@ -from logbook import Logger +try: + from logbook import Logger +except ImportError: + from logging import Logger from .worker import Worker def run_daemon(queue_keys, rv_ttl=500): diff --git a/rq/worker.py b/rq/worker.py index c7d8acd..58709d5 100644 --- a/rq/worker.py +++ b/rq/worker.py @@ -3,7 +3,10 @@ import os import random import time import procname -from logbook import Logger +try: + from logbook import Logger +except ImportError: + from logging import Logger from pickle import loads, dumps from .queue import Queue from .proxy import conn