diff --git a/stdlib/ntpath.pyi b/stdlib/ntpath.pyi index 4ee1b31c6..bcd58b532 100644 --- a/stdlib/ntpath.pyi +++ b/stdlib/ntpath.pyi @@ -52,18 +52,10 @@ def normcase(s: AnyStr) -> AnyStr: ... def normpath(path: PathLike[AnyStr]) -> AnyStr: ... @overload def normpath(path: AnyStr) -> AnyStr: ... - -if sys.platform == "win32": - @overload - def realpath(path: PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(path: AnyStr) -> AnyStr: ... - -else: - @overload - def realpath(filename: PathLike[AnyStr]) -> AnyStr: ... - @overload - def realpath(filename: AnyStr) -> AnyStr: ... +@overload +def realpath(path: PathLike[AnyStr]) -> AnyStr: ... +@overload +def realpath(path: AnyStr) -> AnyStr: ... # In reality it returns str for sequences of StrPath and bytes for sequences # of BytesPath, but mypy does not accept such a signature. diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index 98f078be8..1122bfabf 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -712,7 +712,7 @@ if sys.platform != "win32": ) -> Iterator[Tuple[str, List[str], List[str], int]]: ... if sys.platform == "linux": def getxattr(path: _FdOrAnyPath, attribute: AnyPath, *, follow_symlinks: bool = ...) -> bytes: ... - def listxattr(path: _FdOrAnyPath, *, follow_symlinks: bool = ...) -> List[str]: ... + def listxattr(path: Optional[_FdOrAnyPath] = ..., *, follow_symlinks: bool = ...) -> List[str]: ... def removexattr(path: _FdOrAnyPath, attribute: AnyPath, *, follow_symlinks: bool = ...) -> None: ... def setxattr( path: _FdOrAnyPath, attribute: AnyPath, value: bytes, flags: int = ..., *, follow_symlinks: bool = ... diff --git a/tests/stubtest_whitelists/linux.txt b/tests/stubtest_whitelists/linux.txt index 3fc064b1a..e96488798 100644 --- a/tests/stubtest_whitelists/linux.txt +++ b/tests/stubtest_whitelists/linux.txt @@ -1,15 +1,14 @@ _posixsubprocess.cloexec_pipe _?curses.ACS_.* # ACS codes are initialized only after initscr call. -curses.COLORS -curses.COLOR_PAIRS -curses.COLS -curses.LINES +curses.COLORS # Initialized after start_color +curses.COLOR_PAIRS # Initialized after start_color +curses.COLS # Initialized only after initscr call. +curses.LINES # Initialized only after initscr call. distutils.command.bdist_msi # msi is only available on windows grp.getgrgid grp.struct_group._asdict grp.struct_group._make grp.struct_group._replace -ntpath.realpath os.EX_NOTFOUND os.SF_MNOWAIT os.SF_NODISKIO @@ -17,7 +16,6 @@ os.SF_SYNC os.chflags os.lchflags os.lchmod -os.listxattr os.plock posix.EX_NOTFOUND select.EPOLL_RDHUP