MCPcopy
hub / github.com/treeverse/dvc / _win_detached_subprocess

Function _win_detached_subprocess

dvc/daemon.py:31–56  ·  view source on GitHub ↗
(args: Sequence[str], **kwargs)

Source from the content-addressed store, hash-verified

29
30
31def _win_detached_subprocess(args: Sequence[str], **kwargs) -> int:
32 assert os.name == "nt"
33
34 from subprocess import ( # type: ignore[attr-defined]
35 CREATE_NEW_PROCESS_GROUP, # ty: ignore[unresolved-import]
36 CREATE_NO_WINDOW, # ty: ignore[unresolved-import]
37 STARTF_USESHOWWINDOW, # ty: ignore[unresolved-import]
38 STARTUPINFO, # ty: ignore[unresolved-import]
39 )
40
41 # https://stackoverflow.com/a/7006424
42 # https://bugs.python.org/issue41619
43 creationflags = CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW
44
45 startupinfo = STARTUPINFO()
46 startupinfo.dwFlags |= STARTF_USESHOWWINDOW
47 popen = subprocess.Popen( # noqa: S603
48 args,
49 close_fds=True,
50 shell=False,
51 startupinfo=startupinfo,
52 creationflags=creationflags,
53 **kwargs,
54 )
55 _suppress_resource_warning(popen)
56 return popen.pid
57
58
59def _get_dvc_args() -> list[str]:

Callers 1

_detached_subprocessFunction · 0.85

Calls 1

Tested by

no test coverage detected