mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
d976098e3b
commit
2a12974bca
12 changed files with 50 additions and 39 deletions
|
@ -343,7 +343,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
# Test sys._current_frames() in a WITH_THREADS build.
|
||||
@test.support.reap_threads
|
||||
def current_frames_with_threads(self):
|
||||
import threading, _thread
|
||||
import threading
|
||||
import traceback
|
||||
|
||||
# Spawn a thread that blocks at a known place. Then the main
|
||||
|
@ -357,7 +357,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
g456()
|
||||
|
||||
def g456():
|
||||
thread_info.append(_thread.get_ident())
|
||||
thread_info.append(threading.get_ident())
|
||||
entered_g.set()
|
||||
leave_g.wait()
|
||||
|
||||
|
@ -373,7 +373,7 @@ class SysModuleTest(unittest.TestCase):
|
|||
|
||||
d = sys._current_frames()
|
||||
|
||||
main_id = _thread.get_ident()
|
||||
main_id = threading.get_ident()
|
||||
self.assertIn(main_id, d)
|
||||
self.assertIn(thread_id, d)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue