Fix Curses interface for Python 2.6

In 2.6 all logging classes are not the new-style ones, so they
have no mro() method and, thus, we can't use super() for them.
Since CursesLogHanler is singly-inherited method, there will
be no problems in usage of the explicit superclass name.

Signed-off-by: Eygene Ryabinkin <rea@codelabs.ru>
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
This commit is contained in:
Eygene Ryabinkin 2012-02-19 20:55:06 +04:00 committed by Sebastian Spaeth
parent 29ba2fc523
commit 2f88b0296a
2 changed files with 3 additions and 1 deletions

View File

@ -48,3 +48,5 @@ Changes
Bug Fixes Bug Fixes
--------- ---------
* Improve compatability of the curses UI with python 2.6

View File

@ -281,7 +281,7 @@ class CursesLogHandler(logging.StreamHandler):
"""self.ui has been set to the UI class before anything is invoked""" """self.ui has been set to the UI class before anything is invoked"""
def emit(self, record): def emit(self, record):
log_str = super(CursesLogHandler, self).format(record) log_str = logging.StreamHandler.format(self, record)
color = self.ui.gettf().curses_color color = self.ui.gettf().curses_color
# We must acquire both locks. Otherwise, deadlock can result. # We must acquire both locks. Otherwise, deadlock can result.
# This can happen if one thread calls _msg (locking curses, then # This can happen if one thread calls _msg (locking curses, then