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.
This commit is contained in:
Vincent Driessen 2013-01-23 20:34:08 +01:00
parent 77fb32791d
commit e1b81b1669
1 changed files with 6 additions and 1 deletions

View File

@ -9,6 +9,8 @@ import os
import sys import sys
import logging import logging
from compat import is_python_version
def gettermsize(): def gettermsize():
def ioctl_GWINSZ(fd): def ioctl_GWINSZ(fd):
@ -134,7 +136,10 @@ class ColorizingStreamHandler(logging.StreamHandler):
def __init__(self, exclude=None, *args, **kwargs): def __init__(self, exclude=None, *args, **kwargs):
self.exclude = exclude 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 @property
def is_tty(self): def is_tty(self):