Add stubs for posix_spawn and posix_spawnp (#5846)

This commit is contained in:
an onion
2021-08-05 21:55:26 -04:00
committed by GitHub
parent 74c3d9a093
commit f30d6f6fd0
2 changed files with 33 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
import sys
from os import PathLike, stat_result as stat_result
from typing import Dict, List, NamedTuple, Optional, overload
from _typeshed import StrOrBytesPath
from os import PathLike, _ExecEnv, _ExecVArgs, stat_result as stat_result
from typing import Any, Dict, Iterable, List, NamedTuple, Optional, Sequence, Tuple, overload
class uname_result(NamedTuple):
sysname: str
@@ -166,6 +167,34 @@ def listdir(path: int) -> List[str]: ...
@overload
def listdir(path: PathLike[str]) -> List[str]: ...
if sys.platform != "win32" and sys.version_info >= (3, 8):
def posix_spawn(
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
*,
file_actions: Optional[Sequence[Tuple[Any, ...]]] = ...,
setpgroup: Optional[int] = ...,
resetids: bool = ...,
setsid: bool = ...,
setsigmask: Iterable[int] = ...,
setsigdef: Iterable[int] = ...,
scheduler: Optional[Tuple[Any, sched_param]] = ...,
) -> int: ...
def posix_spawnp(
path: StrOrBytesPath,
argv: _ExecVArgs,
env: _ExecEnv,
*,
file_actions: Optional[Sequence[Tuple[Any, ...]]] = ...,
setpgroup: Optional[int] = ...,
resetids: bool = ...,
setsid: bool = ...,
setsigmask: Iterable[int] = ...,
setsigdef: Iterable[int] = ...,
scheduler: Optional[Tuple[Any, sched_param]] = ...,
) -> int: ...
if sys.platform == "win32":
environ: Dict[str, str]
else: