mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-30 08:04:24 +08:00
Make os.fchdir, os.fsync, and os.fdatasync accept FileDescriptorLike (#4544)
For the fd passed to these functions, CPython accepts not just an int, but also anything with a fileno() method. Fixes #4539
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import FileDescriptorLike
|
||||
from typing import IO, AnyStr, Dict, List, Mapping, NamedTuple, Optional, Sequence, Tuple, TypeVar, Union
|
||||
|
||||
error = OSError
|
||||
@@ -105,17 +106,17 @@ def dup(fd: int) -> int: ...
|
||||
def dup2(fd: int, fd2: int) -> None: ...
|
||||
def execv(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
|
||||
def execve(path: str, args: Sequence[str], env: Mapping[str, str]) -> None: ...
|
||||
def fchdir(fd: int) -> None: ...
|
||||
def fchdir(fd: FileDescriptorLike) -> None: ...
|
||||
def fchmod(fd: int, mode: int) -> None: ...
|
||||
def fchown(fd: int, uid: int, gid: int) -> None: ...
|
||||
def fdatasync(fd: int) -> None: ...
|
||||
def fdatasync(fd: FileDescriptorLike) -> None: ...
|
||||
def fdopen(fd: int, mode: str = ..., bufsize: int = ...) -> IO[str]: ...
|
||||
def fork() -> int: ...
|
||||
def forkpty() -> Tuple[int, int]: ...
|
||||
def fpathconf(fd: int, name: str) -> None: ...
|
||||
def fstat(fd: int) -> stat_result: ...
|
||||
def fstatvfs(fd: int) -> statvfs_result: ...
|
||||
def fsync(fd: int) -> None: ...
|
||||
def fsync(fd: FileDescriptorLike) -> None: ...
|
||||
def ftruncate(fd: int, length: int) -> None: ...
|
||||
def getcwd() -> str: ...
|
||||
def getcwdu() -> unicode: ...
|
||||
|
||||
Reference in New Issue
Block a user