From 76e62236fd10647262d9423e5294217d7d35a0ee Mon Sep 17 00:00:00 2001 From: sobolevn Date: Thu, 31 Aug 2023 15:55:55 +0300 Subject: [PATCH 1/2] Update `os.DirEntry` to 3.12 --- stdlib/os/__init__.pyi | 2 ++ tests/stubtest_allowlists/py312.txt | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/os/__init__.pyi b/stdlib/os/__init__.pyi index f1017984529c..961858ce3c19 100644 --- a/stdlib/os/__init__.pyi +++ b/stdlib/os/__init__.pyi @@ -388,6 +388,8 @@ class DirEntry(Generic[AnyStr]): def __fspath__(self) -> AnyStr: ... if sys.version_info >= (3, 9): def __class_getitem__(cls, item: Any) -> GenericAlias: ... + if sys.version_info >= (3, 12): + def is_junction(self) -> bool: ... @final class statvfs_result(structseq[int], tuple[int, int, int, int, int, int, int, int, int, int, int]): diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 8e585797d3ea..106cb339e894 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -33,7 +33,6 @@ importlib.resources.files importlib.util.module_for_loader importlib.util.set_loader importlib.util.set_package -os.DirEntry.is_junction pathlib.Path.__init__ pathlib.PurePath.__init__ pathlib.PurePath.is_relative_to From 5be24d48b87bf1163c789a338ae6ae9ae8667d01 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Thu, 31 Aug 2023 14:18:56 +0100 Subject: [PATCH 2/2] More unused allowlist entries --- tests/stubtest_allowlists/darwin-py312.txt | 1 - tests/stubtest_allowlists/linux-py312.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index a2ca63a7655d..3c63d5b66008 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -8,7 +8,6 @@ os.PRIO_DARWIN_BG os.PRIO_DARWIN_NONUI os.PRIO_DARWIN_PROCESS os.PRIO_DARWIN_THREAD -posix.DirEntry.is_junction posix.PRIO_DARWIN_BG posix.PRIO_DARWIN_NONUI posix.PRIO_DARWIN_PROCESS diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index ce665e57638f..da263d35c34d 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -13,7 +13,6 @@ _posixsubprocess.fork_exec (os|posix).CLONE_SYSVSEM (os|posix).CLONE_THREAD (os|posix).CLONE_VM -(os|posix).DirEntry.is_junction (os|posix).EFD_CLOEXEC (os|posix).EFD_NONBLOCK (os|posix).EFD_SEMAPHORE