mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-03 10:03:32 +08:00
Make posix module empty on windows (#6427)
This commit is contained in:
@@ -13,7 +13,6 @@ from _typeshed import (
|
||||
from builtins import OSError
|
||||
from contextlib import AbstractContextManager
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper
|
||||
from posix import listdir as listdir, times_result
|
||||
from subprocess import Popen
|
||||
from typing import (
|
||||
IO,
|
||||
@@ -27,6 +26,7 @@ from typing import (
|
||||
List,
|
||||
Mapping,
|
||||
MutableMapping,
|
||||
NamedTuple,
|
||||
NoReturn,
|
||||
Protocol,
|
||||
Sequence,
|
||||
@@ -312,6 +312,15 @@ class PathLike(Protocol[_AnyStr_co]):
|
||||
if sys.version_info >= (3, 9):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
@overload
|
||||
def listdir(path: str | None = ...) -> list[str]: ...
|
||||
@overload
|
||||
def listdir(path: bytes) -> list[bytes]: ...
|
||||
@overload
|
||||
def listdir(path: int) -> list[str]: ...
|
||||
@overload
|
||||
def listdir(path: PathLike[str]) -> list[str]: ...
|
||||
|
||||
_FdOrAnyPath = Union[int, StrOrBytesPath]
|
||||
|
||||
@final
|
||||
@@ -788,6 +797,14 @@ else:
|
||||
def spawnve(__mode: int, __path: StrOrBytesPath, __argv: _ExecVArgs, __env: _ExecEnv) -> int: ...
|
||||
|
||||
def system(command: StrOrBytesPath) -> int: ...
|
||||
@final
|
||||
class times_result(NamedTuple):
|
||||
user: float
|
||||
system: float
|
||||
children_user: float
|
||||
children_system: float
|
||||
elapsed: float
|
||||
|
||||
def times() -> times_result: ...
|
||||
def waitpid(__pid: int, __options: int) -> tuple[int, int]: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user