mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
shutil.rmtree: Add onexc parameter; add parameter defaults (#10219)
This commit is contained in:
@@ -87,22 +87,46 @@ else:
|
||||
ignore_dangling_symlinks: bool = False,
|
||||
) -> _PathReturn: ...
|
||||
|
||||
_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], Any, Any], object]
|
||||
_OnErrorCallback: TypeAlias = Callable[[Callable[..., Any], str, Any], object]
|
||||
_OnExcCallback: TypeAlias = Callable[[Callable[..., Any], str, Exception], object]
|
||||
|
||||
class _RmtreeType(Protocol):
|
||||
avoids_symlink_attacks: bool
|
||||
if sys.version_info >= (3, 11):
|
||||
if sys.version_info >= (3, 12):
|
||||
@overload
|
||||
def __call__(
|
||||
self,
|
||||
path: StrOrBytesPath,
|
||||
ignore_errors: bool = ...,
|
||||
onerror: _OnErrorCallback | None = ...,
|
||||
ignore_errors: bool = False,
|
||||
onerror: _OnErrorCallback | None = None,
|
||||
*,
|
||||
dir_fd: int | None = ...,
|
||||
onexc: None = None,
|
||||
dir_fd: int | None = None,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def __call__(
|
||||
self,
|
||||
path: StrOrBytesPath,
|
||||
ignore_errors: bool = False,
|
||||
onerror: None = None,
|
||||
*,
|
||||
onexc: _OnExcCallback,
|
||||
dir_fd: int | None = None,
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 11):
|
||||
def __call__(
|
||||
self,
|
||||
path: StrOrBytesPath,
|
||||
ignore_errors: bool = False,
|
||||
onerror: _OnErrorCallback | None = None,
|
||||
*,
|
||||
dir_fd: int | None = None,
|
||||
) -> None: ...
|
||||
|
||||
else:
|
||||
def __call__(self, path: StrOrBytesPath, ignore_errors: bool = ..., onerror: _OnErrorCallback | None = ...) -> None: ...
|
||||
def __call__(
|
||||
self, path: StrOrBytesPath, ignore_errors: bool = False, onerror: _OnErrorCallback | None = None
|
||||
) -> None: ...
|
||||
|
||||
rmtree: _RmtreeType
|
||||
|
||||
|
||||
Reference in New Issue
Block a user