From a4e33d4053e3c3310459f480890cee1b1bb97753 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Thu, 25 May 2023 01:53:25 -0700 Subject: [PATCH] shutil.unpack_archive: update for py312 (#10215) Add the new "filter" parameter --- stdlib/shutil.pyi | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index e8eb46833..4b6ff20a9 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -167,7 +167,15 @@ def register_archive_format( name: str, function: Callable[[str, str], object], extra_args: None = None, description: str = "" ) -> None: ... def unregister_archive_format(name: str) -> None: ... -def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... + +if sys.version_info >= (3, 12): + def unpack_archive( + filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None, *, filter: str | None = None + ) -> None: ... + +else: + def unpack_archive(filename: StrPath, extract_dir: StrPath | None = None, format: str | None = None) -> None: ... + @overload def register_unpack_format( name: str,