Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ceda368

Browse files
authored
shutil: update rmtree for py311 (#7925)
1 parent c0aafb9 commit ceda368

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

stdlib/shutil.pyi

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,17 @@ else:
8282
ignore_dangling_symlinks: bool = ...,
8383
) -> _PathReturn: ...
8484

85-
def rmtree(path: StrOrBytesPath, ignore_errors: bool = ..., onerror: Callable[[Any, Any, Any], Any] | None = ...) -> None: ...
85+
if sys.version_info >= (3, 11):
86+
def rmtree(
87+
path: StrOrBytesPath,
88+
ignore_errors: bool = ...,
89+
onerror: Callable[[Any, Any, Any], Any] | None = ...,
90+
*,
91+
dir_fd: int | None = ...,
92+
) -> None: ...
93+
94+
else:
95+
def rmtree(path: StrOrBytesPath, ignore_errors: bool = ..., onerror: Callable[[Any, Any, Any], Any] | None = ...) -> None: ...
8696

8797
_CopyFn: TypeAlias = Callable[[str, str], None] | Callable[[StrPath, StrPath], None]
8898

tests/stubtest_allowlists/py311.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ platform.uname_result.__new__
7373
platform.uname_result._fields
7474
platform.uname_result.processor
7575
queue.SimpleQueue.__init__
76-
shutil.rmtree
7776
socketserver.UDPServer.allow_reuse_port
7877
string.Template.get_identifiers
7978
string.Template.is_valid

0 commit comments

Comments
 (0)