threadutil: explicitly import get_ident from thread

The python module thread is the low-level module we should avoid to use in favor
of threading. We still need it to support old python because Thread.ident
doesn't exist before python 2.6:

	http://docs.python.org/library/threading.html#threading.Thread.ident

Make it clear we should avoid it.

Reviewed-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Nicolas Sebrecht
2011-05-11 19:34:59 +02:00
parent 8a34edc8ca
commit d5493fe894
3 changed files with 8 additions and 10 deletions

View File

@ -18,7 +18,7 @@
from threading import RLock, currentThread
from offlineimap.ui.UIBase import UIBase
import thread
from thread import get_ident # python < 2.6 support
class BlinkenBase:
"""This is a mix-in class that should be mixed in with either UIBase
@ -103,7 +103,7 @@ class BlinkenBase:
UIBase.threadExited(s, thread)
def gettf(s):
threadid = thread.get_ident()
threadid = get_ident()
accountname = s.getthreadaccount()
s.tflock.acquire()