mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
clean python 3 specific stuff from stdlib/@python2 stubs (#5451)
This commit is contained in:
@@ -37,15 +37,6 @@ _T = TypeVar("_T")
|
||||
|
||||
error = OSError
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
supports_bytes_environ: bool
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
supports_dir_fd: Set[Callable[..., Any]]
|
||||
supports_fd: Set[Callable[..., Any]]
|
||||
supports_effective_ids: Set[Callable[..., Any]]
|
||||
supports_follow_symlinks: Set[Callable[..., Any]]
|
||||
|
||||
SEEK_SET: int
|
||||
SEEK_CUR: int
|
||||
SEEK_END: int
|
||||
@@ -110,9 +101,6 @@ class _Environ(MutableMapping[AnyStr, AnyStr], Generic[AnyStr]):
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
environ: _Environ[str]
|
||||
if sys.version_info >= (3, 2):
|
||||
environb: _Environ[bytes]
|
||||
|
||||
if sys.platform != "win32":
|
||||
# Unix only
|
||||
confstr_names: Dict[str, int]
|
||||
@@ -245,11 +233,7 @@ def symlink(source: AnyPath, link_name: AnyPath) -> None: ...
|
||||
def unlink(path: AnyPath) -> None: ...
|
||||
|
||||
# TODO: add ns, dir_fd, follow_symlinks argument
|
||||
if sys.version_info >= (3, 0):
|
||||
def utime(path: AnyPath, times: Optional[Tuple[float, float]] = ...) -> None: ...
|
||||
|
||||
else:
|
||||
def utime(path: AnyPath, times: Optional[Tuple[float, float]]) -> None: ...
|
||||
def utime(path: AnyPath, times: Optional[Tuple[float, float]]) -> None: ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
# Unix only
|
||||
@@ -275,19 +259,9 @@ if sys.platform != "win32":
|
||||
def pathconf(path: AnyPath, name: Union[str, int]) -> int: ...
|
||||
def statvfs(path: AnyPath) -> _StatVFS: ...
|
||||
|
||||
if sys.version_info >= (3, 6):
|
||||
def walk(
|
||||
top: Union[AnyStr, PathLike[AnyStr]],
|
||||
topdown: bool = ...,
|
||||
onerror: Optional[Callable[[OSError], Any]] = ...,
|
||||
followlinks: bool = ...,
|
||||
) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ...
|
||||
|
||||
else:
|
||||
def walk(
|
||||
top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., followlinks: bool = ...
|
||||
) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ...
|
||||
|
||||
def walk(
|
||||
top: AnyStr, topdown: bool = ..., onerror: Optional[Callable[[OSError], Any]] = ..., followlinks: bool = ...
|
||||
) -> Iterator[Tuple[AnyStr, List[AnyStr], List[AnyStr]]]: ...
|
||||
def abort() -> NoReturn: ...
|
||||
|
||||
# These are defined as execl(file, *args) but the first *arg is mandatory.
|
||||
@@ -317,18 +291,10 @@ if sys.platform != "win32":
|
||||
def nice(increment: int) -> int: ...
|
||||
def plock(op: int) -> None: ... # ???op is int?
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
class popen(_TextIOWrapper):
|
||||
# TODO 'b' modes or bytes command not accepted?
|
||||
def __init__(self, command: str, mode: str = ..., bufsize: int = ...) -> None: ...
|
||||
def close(self) -> Any: ... # may return int
|
||||
|
||||
else:
|
||||
def popen(command: str, *args, **kwargs) -> IO[Any]: ...
|
||||
def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ...
|
||||
def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ...
|
||||
def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ...
|
||||
|
||||
def popen(command: str, *args, **kwargs) -> IO[Any]: ...
|
||||
def popen2(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ...
|
||||
def popen3(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any], IO[Any]]: ...
|
||||
def popen4(cmd: str, *args, **kwargs) -> Tuple[IO[Any], IO[Any]]: ...
|
||||
def spawnl(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Union[bytes, Text]) -> int: ...
|
||||
def spawnle(mode: int, path: AnyPath, arg0: Union[bytes, Text], *args: Any) -> int: ... # Imprecise sig
|
||||
def spawnv(mode: int, path: AnyPath, args: List[Union[bytes, Text]]) -> int: ...
|
||||
@@ -362,18 +328,9 @@ else:
|
||||
def getloadavg() -> Tuple[float, float, float]: ...
|
||||
def sysconf(name: Union[str, int]) -> int: ...
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
def sched_getaffinity(id: int) -> Set[int]: ...
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class waitresult:
|
||||
si_pid: int
|
||||
def waitid(idtype: int, id: int, options: int) -> waitresult: ...
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
def tmpfile() -> IO[Any]: ...
|
||||
def tmpnam() -> str: ...
|
||||
def tempnam(dir: str = ..., prefix: str = ...) -> str: ...
|
||||
def tmpfile() -> IO[Any]: ...
|
||||
def tmpnam() -> str: ...
|
||||
def tempnam(dir: str = ..., prefix: str = ...) -> str: ...
|
||||
|
||||
P_ALL: int
|
||||
WEXITED: int
|
||||
|
||||
Reference in New Issue
Block a user