mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Fix stubtest failures for os.__init__ on windows (#4098)
This commit is contained in:
@@ -73,13 +73,14 @@ if sys.platform != 'win32':
|
||||
SCHED_RR: int # some flavors of Unix
|
||||
SCHED_RESET_ON_FORK: int # some flavors of Unix
|
||||
|
||||
RTLD_LAZY: int
|
||||
RTLD_NOW: int
|
||||
RTLD_GLOBAL: int
|
||||
RTLD_LOCAL: int
|
||||
RTLD_NODELETE: int
|
||||
RTLD_NOLOAD: int
|
||||
RTLD_DEEPBIND: int
|
||||
if sys.platform != "win32":
|
||||
RTLD_LAZY: int
|
||||
RTLD_NOW: int
|
||||
RTLD_GLOBAL: int
|
||||
RTLD_LOCAL: int
|
||||
RTLD_NODELETE: int
|
||||
RTLD_NOLOAD: int
|
||||
RTLD_DEEPBIND: int
|
||||
|
||||
SEEK_SET: int
|
||||
SEEK_CUR: int
|
||||
@@ -151,7 +152,8 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
environ: _Environ[str]
|
||||
environb: _Environ[bytes]
|
||||
if sys.platform != "win32":
|
||||
environb: _Environ[bytes]
|
||||
|
||||
if sys.platform != 'win32':
|
||||
confstr_names: Dict[str, int]
|
||||
@@ -365,12 +367,15 @@ if sys.platform != 'win32':
|
||||
def getenv(key: Text) -> Optional[str]: ...
|
||||
@overload
|
||||
def getenv(key: Text, default: _T) -> Union[str, _T]: ...
|
||||
@overload
|
||||
def getenvb(key: bytes) -> Optional[bytes]: ...
|
||||
@overload
|
||||
def getenvb(key: bytes, default: _T = ...) -> Union[bytes, _T]: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
@overload
|
||||
def getenvb(key: bytes) -> Optional[bytes]: ...
|
||||
@overload
|
||||
def getenvb(key: bytes, default: _T = ...) -> Union[bytes, _T]: ...
|
||||
def putenv(__name: Union[bytes, Text], __value: Union[bytes, Text]) -> None: ...
|
||||
def unsetenv(__name: Union[bytes, Text]) -> None: ...
|
||||
if sys.platform != "win32":
|
||||
def unsetenv(__name: Union[bytes, Text]) -> None: ...
|
||||
|
||||
# Return IO or TextIO
|
||||
def fdopen(fd: int, mode: str = ..., buffering: int = ..., encoding: Optional[str] = ...,
|
||||
@@ -441,7 +446,9 @@ def access(
|
||||
follow_symlinks: bool = ...,
|
||||
) -> bool: ...
|
||||
def chdir(path: _FdOrPathType) -> None: ...
|
||||
def fchdir(fd: int) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
def fchdir(fd: int) -> None: ...
|
||||
def getcwd() -> str: ...
|
||||
def getcwdb() -> bytes: ...
|
||||
def chmod(path: _FdOrPathType, mode: int, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> None: ...
|
||||
@@ -468,11 +475,11 @@ def mkdir(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> N
|
||||
if sys.platform != 'win32':
|
||||
def mkfifo(path: _PathType, mode: int = ..., *, dir_fd: Optional[int] = ...) -> None: ... # Unix only
|
||||
def makedirs(name: _PathType, mode: int = ..., exist_ok: bool = ...) -> None: ...
|
||||
def mknod(path: _PathType, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def major(__device: int) -> int: ...
|
||||
def minor(__device: int) -> int: ...
|
||||
def makedev(__major: int, __minor: int) -> int: ...
|
||||
if sys.platform != 'win32':
|
||||
if sys.platform != "win32":
|
||||
def mknod(path: _PathType, mode: int = ..., device: int = ..., *, dir_fd: Optional[int] = ...) -> None: ...
|
||||
def major(__device: int) -> int: ...
|
||||
def minor(__device: int) -> int: ...
|
||||
def makedev(__major: int, __minor: int) -> int: ...
|
||||
def pathconf(path: _FdOrPathType, name: Union[str, int]) -> int: ... # Unix only
|
||||
if sys.version_info >= (3, 6):
|
||||
def readlink(path: Union[AnyStr, PathLike[AnyStr]], *, dir_fd: Optional[int] = ...) -> AnyStr: ...
|
||||
@@ -607,9 +614,14 @@ def popen(cmd: str, mode: str = ..., buffering: int = ...) -> _wrap_close: ...
|
||||
def spawnl(mode: int, file: _PathType, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ...
|
||||
def spawnle(mode: int, file: _PathType, arg0: Union[bytes, Text],
|
||||
*args: Any) -> int: ... # Imprecise sig
|
||||
def spawnv(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ...
|
||||
def spawnve(mode: int, file: _PathType, args: List[Union[bytes, Text]],
|
||||
env: _ExecEnv) -> int: ...
|
||||
if sys.platform != "win32":
|
||||
def spawnv(mode: int, file: _PathType, args: List[Union[bytes, Text]]) -> int: ...
|
||||
def spawnve(mode: int, file: _PathType, args: List[Union[bytes, Text]],
|
||||
env: _ExecEnv) -> int: ...
|
||||
else:
|
||||
def spawnv(__mode: int, __path: _PathType, __argv: List[Union[bytes, Text]]) -> int: ...
|
||||
def spawnve(__mode: int, __path: _PathType, __argv: List[Union[bytes, Text]],
|
||||
__env: _ExecEnv) -> int: ...
|
||||
def system(command: _PathType) -> int: ...
|
||||
def times() -> times_result: ...
|
||||
def waitpid(__pid: int, __options: int) -> Tuple[int, int]: ...
|
||||
@@ -660,7 +672,7 @@ if sys.version_info >= (3, 6):
|
||||
def getrandom(size: int, flags: int = ...) -> bytes: ...
|
||||
def urandom(__size: int) -> bytes: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
if sys.version_info >= (3, 7) and sys.platform != "win32":
|
||||
def register_at_fork(
|
||||
*,
|
||||
before: Optional[Callable[..., Any]] = ...,
|
||||
|
||||
Reference in New Issue
Block a user