()
| 15 | |
| 16 | |
| 17 | def 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 | |
| 38 | def launch_python_daemon( |
no outgoing calls
no test coverage detected