From dee4ef317110d9ea483d346f2440112ffc02bba9 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 8 Feb 2025 20:46:09 -0500 Subject: [PATCH] Still allow passing `None` to `shutil.rmtree`'s `onerror` parameter on Python 3.12+ (#13478) Resolves https://github.com/python/mypy/issues/18239 --- stdlib/shutil.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index dcff18d11..4a19a96a3 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -83,7 +83,7 @@ class _RmtreeType(Protocol): self, path: StrOrBytesPath, ignore_errors: bool, - onerror: _OnErrorCallback, + onerror: _OnErrorCallback | None, *, onexc: None = None, dir_fd: int | None = None, @@ -95,7 +95,7 @@ class _RmtreeType(Protocol): path: StrOrBytesPath, ignore_errors: bool = False, *, - onerror: _OnErrorCallback, + onerror: _OnErrorCallback | None, onexc: None = None, dir_fd: int | None = None, ) -> None: ...