fix for a bug reported by m4l1c3 (AttributeError: '_MainThread' object has no attribute 'ident')

This commit is contained in:
Miroslav Stampar 2010-12-20 23:47:53 +00:00
parent e10670d9ac
commit 8067365b93
2 changed files with 7 additions and 7 deletions

View File

@ -409,7 +409,7 @@ james <james@ev6.net>
for reporting a bug
m4l1c3 <malice.anon@gmail.com>
for reporting a minor bug
for reporting a few bugs
mariano <marianoso@gmail.com>
for reporting a bug

View File

@ -1541,18 +1541,18 @@ def longestCommonPrefix(*sequences):
def commonFinderOnly(initial, sequence):
return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence))
def getCurrentThreadID():
return threading.currentThread().ident
def getCurrentThreadUID():
return hash(threading.currentThread())
def getCurrentThreadData():
"""
Returns current thread's dependent data
"""
threadID = getCurrentThreadID()
if threadID not in kb.threadData:
kb.threadData[threadID] = ThreadData()
return kb.threadData[threadID]
threadUID = getCurrentThreadUID()
if threadUID not in kb.threadData:
kb.threadData[threadUID] = ThreadData()
return kb.threadData[threadUID]
def pushValue(value):
"""