Close #12028: Make threading._get_ident() public, rename it to

threading.get_ident() and document it. This function was used by
_thread.get_ident().
This commit is contained in:
Victor Stinner 2011-05-30 23:02:52 +02:00
parent d976098e3b
commit 2a12974bca
12 changed files with 50 additions and 39 deletions

View file

@ -190,18 +190,17 @@ def test_main():
idents = []
def callback():
idents.append(_thread.get_ident())
idents.append(threading.get_ident())
_testcapi._test_thread_state(callback)
a = b = callback
time.sleep(1)
# Check our main thread is in the list exactly 3 times.
if idents.count(_thread.get_ident()) != 3:
if idents.count(threading.get_ident()) != 3:
raise support.TestFailed(
"Couldn't find main thread correctly in the list")
if threading:
import _thread
import time
TestThreadState()
t = threading.Thread(target=TestThreadState)