os: fix getenvb, scandir (#3723)

* os: fix getenvb
* os: scandir accepts None
This commit is contained in:
Shantanu
2020-02-05 11:55:45 -08:00
committed by GitHub
parent 35e45964fc
commit 10d33f5364

View File

@@ -361,7 +361,10 @@ if sys.platform != 'win32':
def getenv(key: Text) -> Optional[str]: ...
@overload
def getenv(key: Text, default: _T) -> Union[str, _T]: ...
def getenvb(key: bytes, default: bytes = ...) -> bytes: ...
@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: ...
@@ -480,7 +483,7 @@ if sys.version_info >= (3, 7):
def __next__(self) -> DirEntry[AnyStr]: ...
def close(self) -> None: ...
@overload
def scandir() -> _ScandirIterator[str]: ...
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
@overload
def scandir(path: int) -> _ScandirIterator[str]: ...
@overload
@@ -490,12 +493,12 @@ elif sys.version_info >= (3, 6):
def __next__(self) -> DirEntry[AnyStr]: ...
def close(self) -> None: ...
@overload
def scandir() -> _ScandirIterator[str]: ...
def scandir(path: None = ...) -> _ScandirIterator[str]: ...
@overload
def scandir(path: Union[AnyStr, PathLike[AnyStr]]) -> _ScandirIterator[AnyStr]: ...
else:
@overload
def scandir() -> Iterator[DirEntry[str]]: ...
def scandir(path: None = ...) -> Iterator[DirEntry[str]]: ...
@overload
def scandir(path: AnyStr) -> Iterator[DirEntry[AnyStr]]: ...
def stat(path: _FdOrPathType, *, dir_fd: Optional[int] = ..., follow_symlinks: bool = ...) -> stat_result: ...