MCPcopy Create free account
hub / github.com/tox-dev/filelock / fork_process

Function fork_process

tests/fork_helpers.py:30–37  ·  view source on GitHub ↗
(child: Callable[[], NoReturn] | None = None)

Source from the content-addressed store, hash-verified

28
29
30def fork_process(child: Callable[[], NoReturn] | None = None) -> int: # pragma: win32 no cover
31 if _FORK is None: # pragma: no cover - platform without os.fork
32 msg = "os.fork is unavailable"
33 raise RuntimeError(msg)
34 child_pid = _FORK()
35 if child_pid == 0 and child is not None: # pragma: win32 no cover
36 child() # pragma: no cover - child coverage starts after fork returns to this frame
37 return child_pid
38
39
40def exit_child(status: int) -> NoReturn:

Calls

no outgoing calls