File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1282,17 +1282,21 @@ def test_native_id_after_fork(self):
12821282 import threading
12831283 import os
12841284
1285- print(threading.current_thread().native_id, flush=True)
1286- assert threading.current_thread().native_id == threading.get_native_id()
1285+ parent_thread_native_id = threading.current_thread().native_id
1286+ print(parent_thread_native_id, flush=True)
1287+ assert parent_thread_native_id == threading.get_native_id()
12871288 if os.fork() == 0:
12881289 print(threading.current_thread().native_id, flush=True)
12891290 assert threading.current_thread().native_id == threading.get_native_id()
1291+ else:
1292+ assert parent_thread_native_id == threading.current_thread().native_id
1293+ assert parent_thread_native_id == threading.get_native_id()
12901294 """
12911295 rc , out , err = assert_python_ok ('-c' , script )
12921296 self .assertEqual (rc , 0 )
12931297 self .assertEqual (err , b"" )
12941298 native_ids = out .strip ().splitlines ()
1295- self .assertEqual (len (native_ids ), 2 )
1299+ self .assertEqual (len (native_ids ), 3 )
12961300 self .assertNotEqual (native_ids [0 ], native_ids [1 ])
12971301
12981302class ThreadJoinOnShutdown (BaseTestCase ):
You can’t perform that action at this time.
0 commit comments