MCPcopy
hub / github.com/pex-tool/pex / subprocess_daemon_kwargs

Function subprocess_daemon_kwargs

pex/subprocess.py:17–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16
17def subprocess_daemon_kwargs():
18 # type: () -> Dict[str, Any]
19
20 if WINDOWS:
21 return {
22 "creationflags": (
23 # The subprocess.{DETACHED_PROCESS,CREATE_NEW_PROCESS_GROUP} attributes are only
24 # defined on Windows.
25 subprocess.DETACHED_PROCESS # type: ignore[attr-defined]
26 | subprocess.CREATE_NEW_PROCESS_GROUP # type: ignore[attr-defined]
27 )
28 }
29 elif sys.version_info[:2] >= (3, 2):
30 return {"start_new_session": True}
31 else:
32 return {
33 # The os.setsid function is not available on Windows.
34 "preexec_fn": os.setsid # type: ignore[attr-defined]
35 }
36
37
38def launch_python_daemon(

Callers 3

runMethod · 0.90
try_run_programFunction · 0.90
launch_python_daemonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected