Make various os functions available on Windows (#6500)

This commit is contained in:
Alex Waygood
2021-12-05 20:06:22 +00:00
committed by GitHub
parent 28803c4c4a
commit 415d387009
7 changed files with 13 additions and 34 deletions

View File

@@ -416,6 +416,13 @@ def getpid() -> int: ...
def getppid() -> int: ...
def strerror(__code: int) -> str: ...
def umask(__mask: int) -> int: ...
@final
class uname_result(NamedTuple):
sysname: str
nodename: str
release: str
version: str
machine: str
if sys.platform != "win32":
def ctermid() -> str: ...
@@ -447,13 +454,6 @@ if sys.platform != "win32":
def getsid(__pid: int) -> int: ...
def setsid() -> None: ...
def setuid(__uid: int) -> None: ...
@final
class uname_result(NamedTuple):
sysname: str
nodename: str
release: str
version: str
machine: str
def uname() -> uname_result: ...
@overload
@@ -469,7 +469,7 @@ if sys.platform != "win32":
def putenv(__name: bytes | str, __value: bytes | str) -> None: ...
if sys.platform != "win32":
if sys.platform != "win32" or sys.version_info >= (3, 9):
def unsetenv(__name: bytes | str) -> None: ...
_Opener = Callable[[str, int], int]
@@ -563,7 +563,9 @@ else:
def dup2(fd: int, fd2: int, inheritable: bool = ...) -> None: ...
def fstat(fd: int) -> stat_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def fsync(fd: FileDescriptorLike) -> None: ...
def isatty(__fd: int) -> bool: ...
def lseek(__fd: int, __position: int, __how: int) -> int: ...
def open(path: StrOrBytesPath, flags: int, mode: int = ..., *, dir_fd: int | None = ...) -> int: ...
def pipe() -> tuple[int, int]: ...
@@ -577,10 +579,8 @@ if sys.platform != "win32":
def fdatasync(fd: FileDescriptorLike) -> None: ... # Unix only, not Mac
def fpathconf(__fd: int, __name: str | int) -> int: ...
def fstatvfs(__fd: int) -> statvfs_result: ...
def ftruncate(__fd: int, __length: int) -> None: ...
def get_blocking(__fd: int) -> bool: ...
def set_blocking(__fd: int, __blocking: bool) -> None: ...
def isatty(__fd: int) -> bool: ...
def lockf(__fd: int, __command: int, __length: int) -> None: ...
def openpty() -> tuple[int, int]: ... # some flavors of Unix
if sys.platform != "darwin":