From 8067365b9366b6cc541af7d0dc46ee56562ad927 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 20 Dec 2010 23:47:53 +0000 Subject: [PATCH] fix for a bug reported by m4l1c3 (AttributeError: '_MainThread' object has no attribute 'ident') --- doc/THANKS | 2 +- lib/core/common.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/THANKS b/doc/THANKS index 0da9d1bfa..2aaac8c83 100644 --- a/doc/THANKS +++ b/doc/THANKS @@ -409,7 +409,7 @@ james for reporting a bug m4l1c3 - for reporting a minor bug + for reporting a few bugs mariano for reporting a bug diff --git a/lib/core/common.py b/lib/core/common.py index 6322e5e20..15c37e7fa 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -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): """