[PATCH] restore compatibilty with python 2.5 for ui TTY

Nicolas Sebrecht nicolas.s-dev at laposte.net
Fri Feb 18 19:03:00 GMT 2011


threading.currentThread() used an accessor to get its name.

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev at laposte.net>
---
 Changelog.draft.rst   |    2 ++
 offlineimap/ui/TTY.py |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Changelog.draft.rst b/Changelog.draft.rst
index 8b599f9..ba9de28 100644
--- a/Changelog.draft.rst
+++ b/Changelog.draft.rst
@@ -19,6 +19,8 @@ Changes
 Bug Fixes
 ---------
 
+* Restore compatibiliy with python 2.5.
+
 
 Pending for the next major release
 ==================================
diff --git a/offlineimap/ui/TTY.py b/offlineimap/ui/TTY.py
index 4c574b2..ee18dfa 100644
--- a/offlineimap/ui/TTY.py
+++ b/offlineimap/ui/TTY.py
@@ -37,7 +37,10 @@ class TTYUI(UIBase):
             #if the next output comes from a different thread than our last one
             #add the info.
             #Most look like 'account sync foo' or 'Folder sync foo'.
-            threadname = currentThread().name
+            try:
+                threadname = currentThread().name
+            except AttributeError:
+                threadname = currentThread().getName()
             if (threadname == s._lastThreaddisplay):
                 print " %s" % msg
             else:
-- 
1.7.4.30.gccfc03





More information about the OfflineIMAP-project mailing list