Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8067365

Browse files
committed
fix for a bug reported by m4l1c3 (AttributeError: '_MainThread' object has no attribute 'ident')
1 parent e10670d commit 8067365

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

doc/THANKS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ james <[email protected]>
409409
for reporting a bug
410410

411411
412-
for reporting a minor bug
412+
for reporting a few bugs
413413

414414
415415
for reporting a bug

lib/core/common.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,18 +1541,18 @@ def longestCommonPrefix(*sequences):
15411541
def commonFinderOnly(initial, sequence):
15421542
return longestCommonPrefix(*filter(lambda x: x.startswith(initial), sequence))
15431543

1544-
def getCurrentThreadID():
1545-
return threading.currentThread().ident
1544+
def getCurrentThreadUID():
1545+
return hash(threading.currentThread())
15461546

15471547
def getCurrentThreadData():
15481548
"""
15491549
Returns current thread's dependent data
15501550
"""
15511551

1552-
threadID = getCurrentThreadID()
1553-
if threadID not in kb.threadData:
1554-
kb.threadData[threadID] = ThreadData()
1555-
return kb.threadData[threadID]
1552+
threadUID = getCurrentThreadUID()
1553+
if threadUID not in kb.threadData:
1554+
kb.threadData[threadUID] = ThreadData()
1555+
return kb.threadData[threadUID]
15561556

15571557
def pushValue(value):
15581558
"""

0 commit comments

Comments
 (0)