MCPcopy Index your code
hub / github.com/RustPython/RustPython / run_in_child

Method run_in_child

Lib/test/_test_multiprocessing.py:5431–5443  ·  view source on GitHub ↗
(cls, start_method)

Source from the content-addressed store, hash-verified

5429
5430 @classmethod
5431 def run_in_child(cls, start_method):
5432 import json
5433 mp = multiprocessing.get_context(start_method)
5434 r, w = mp.Pipe(duplex=False)
5435 p = mp.Process(target=cls.run_in_grandchild, args=(w,))
5436 with warnings.catch_warnings(category=DeprecationWarning):
5437 p.start()
5438 grandchild_flags = r.recv()
5439 p.join()
5440 r.close()
5441 w.close()
5442 flags = (tuple(sys.flags), grandchild_flags)
5443 print(json.dumps(flags))
5444
5445 def test_flags(self):
5446 import json

Callers

nothing calls this directly

Calls 9

PipeMethod · 0.80
printFunction · 0.50
get_contextMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
recvMethod · 0.45
joinMethod · 0.45
closeMethod · 0.45
dumpsMethod · 0.45

Tested by

no test coverage detected