From 3c7ffb1cc3847b8f4f940e02c6cfbd89090867e6 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Mon, 5 Aug 2024 15:31:12 -0500 Subject: [PATCH] Update `dircmp` for 3.13 (#12337) --- stdlib/@tests/stubtest_allowlists/py313.txt | 1 - stdlib/filecmp.pyi | 25 +++++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 7c2e02700..2687f993a 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -9,7 +9,6 @@ _thread.start_joinable_thread _tkinter.create doctest.TestResults.__doc__ doctest.TestResults.__new__ -filecmp.dircmp.__init__ importlib.resources.Anchor importlib.resources.Resource importlib.resources.__all__ diff --git a/stdlib/filecmp.pyi b/stdlib/filecmp.pyi index dfec2da72..cb7b94596 100644 --- a/stdlib/filecmp.pyi +++ b/stdlib/filecmp.pyi @@ -17,13 +17,24 @@ def cmpfiles( ) -> tuple[list[AnyStr], list[AnyStr], list[AnyStr]]: ... class dircmp(Generic[AnyStr]): - def __init__( - self, - a: GenericPath[AnyStr], - b: GenericPath[AnyStr], - ignore: Sequence[AnyStr] | None = None, - hide: Sequence[AnyStr] | None = None, - ) -> None: ... + if sys.version_info >= (3, 13): + def __init__( + self, + a: GenericPath[AnyStr], + b: GenericPath[AnyStr], + ignore: Sequence[AnyStr] | None = None, + hide: Sequence[AnyStr] | None = None, + *, + shallow: bool = True, + ) -> None: ... + else: + def __init__( + self, + a: GenericPath[AnyStr], + b: GenericPath[AnyStr], + ignore: Sequence[AnyStr] | None = None, + hide: Sequence[AnyStr] | None = None, + ) -> None: ... left: AnyStr right: AnyStr hide: Sequence[AnyStr]