diff --git a/Changelog.draft.rst b/Changelog.draft.rst index f17387a..21133ec 100644 --- a/Changelog.draft.rst +++ b/Changelog.draft.rst @@ -20,3 +20,5 @@ Changes Bug Fixes --------- + +* Fix python2.6 compatibility with the TTYUI backend (crash) diff --git a/offlineimap/ui/TTY.py b/offlineimap/ui/TTY.py index 2b3e834..862d7a4 100644 --- a/offlineimap/ui/TTY.py +++ b/offlineimap/ui/TTY.py @@ -24,12 +24,14 @@ from offlineimap.ui.UIBase import UIBase class TTYFormatter(logging.Formatter): """Specific Formatter that adds thread information to the log output""" def __init__(self, *args, **kwargs): - super(TTYFormatter, self).__init__(*args, **kwargs) + #super() doesn't work in py2.6 as 'logging' uses old-style class + logging.Formatter.__init__(self, *args, **kwargs) self._last_log_thread = None def format(self, record): """Override format to add thread information""" - log_str = super(TTYFormatter, self).format(record) + #super() doesn't work in py2.6 as 'logging' uses old-style class + log_str = logging.Formatter.format(self, record) # If msg comes from a different thread than our last, prepend # thread info. Most look like 'Account sync foo' or 'Folder # sync foo'.