From e1b81b16696b2ad609ad2e389417fa38cc388b4d Mon Sep 17 00:00:00 2001 From: Vincent Driessen Date: Wed, 23 Jan 2013 20:34:08 +0100 Subject: [PATCH] Avoid new-style classes under Python 2.6. Little ugly fix, required because Python 2.6's logging uses old-style classes. Thanks for finding this one, @deferraz. --- rq/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rq/utils.py b/rq/utils.py index f3b9c54..14241a6 100644 --- a/rq/utils.py +++ b/rq/utils.py @@ -9,6 +9,8 @@ import os import sys import logging +from compat import is_python_version + def gettermsize(): def ioctl_GWINSZ(fd): @@ -134,7 +136,10 @@ class ColorizingStreamHandler(logging.StreamHandler): def __init__(self, exclude=None, *args, **kwargs): self.exclude = exclude - super(ColorizingStreamHandler, self).__init__(*args, **kwargs) + if is_python_version((2,6)): + logging.StreamHandler.__init__(self, *args, **kwargs) + else: + super(ColorizingStreamHandler, self).__init__(*args, **kwargs) @property def is_tty(self):