From 9810d95a28fde5172b0aa8bf11ed3c9792aeeb20 Mon Sep 17 00:00:00 2001 From: Semyon Moroz Date: Sun, 25 May 2025 16:42:10 +0000 Subject: [PATCH] Bump `shutil` to 3.14 (#14134) --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 - stdlib/shutil.pyi | 11 +++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 6065f5042..5f6b23c5d 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -51,7 +51,6 @@ multiprocessing.managers._BaseDictProxy.__ror__ multiprocessing.managers._BaseDictProxy.fromkeys multiprocessing.process.BaseProcess.interrupt multiprocessing.synchronize.SemLock.locked -shutil.__all__ string.Template.flags tarfile.TarFile.zstopen tkinter.Event.__class_getitem__ diff --git a/stdlib/shutil.pyi b/stdlib/shutil.pyi index ea2c29d46..c66d8fa12 100644 --- a/stdlib/shutil.pyi +++ b/stdlib/shutil.pyi @@ -18,7 +18,6 @@ __all__ = [ "rmtree", "Error", "SpecialFileError", - "ExecError", "make_archive", "get_archive_formats", "register_archive_format", @@ -34,6 +33,8 @@ __all__ = [ "SameFileError", "disk_usage", ] +if sys.version_info < (3, 14): + __all__ += ["ExecError"] _StrOrBytesPathT = TypeVar("_StrOrBytesPathT", bound=StrOrBytesPath) _StrPathT = TypeVar("_StrPathT", bound=StrPath) @@ -42,7 +43,13 @@ _BytesPathT = TypeVar("_BytesPathT", bound=BytesPath) class Error(OSError): ... class SameFileError(Error): ... class SpecialFileError(OSError): ... -class ExecError(OSError): ... + +if sys.version_info >= (3, 14): + ExecError = RuntimeError # Deprecated in Python 3.14; removal scheduled for Python 3.16 + +else: + class ExecError(OSError): ... + class ReadError(OSError): ... class RegistryError(Exception): ...