From 27729455a59afcc87b0ed50ddfbd7b742c138ea7 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Wed, 2 Apr 2025 12:27:24 +0200 Subject: [PATCH] Remove dummy threading modules (#13771) Removed in Python 3.8, part of #12112 --- stdlib/VERSIONS | 3 -- stdlib/_dummy_thread.pyi | 33 ---------------------- stdlib/_dummy_threading.pyi | 56 ------------------------------------- stdlib/dummy_threading.pyi | 2 -- 4 files changed, 94 deletions(-) delete mode 100644 stdlib/_dummy_thread.pyi delete mode 100644 stdlib/_dummy_threading.pyi delete mode 100644 stdlib/dummy_threading.pyi diff --git a/stdlib/VERSIONS b/stdlib/VERSIONS index 3c6898dc1..7a8b950b0 100644 --- a/stdlib/VERSIONS +++ b/stdlib/VERSIONS @@ -36,8 +36,6 @@ _curses: 3.0- _curses_panel: 3.0- _dbm: 3.0- _decimal: 3.3- -_dummy_thread: 3.0-3.8 -_dummy_threading: 3.0-3.8 _frozen_importlib: 3.0- _frozen_importlib_external: 3.5- _gdbm: 3.0- @@ -140,7 +138,6 @@ distutils: 3.0-3.11 distutils.command.bdist_msi: 3.0-3.10 distutils.command.bdist_wininst: 3.0-3.9 doctest: 3.0- -dummy_threading: 3.0-3.8 email: 3.0- encodings: 3.0- encodings.cp1125: 3.4- diff --git a/stdlib/_dummy_thread.pyi b/stdlib/_dummy_thread.pyi deleted file mode 100644 index 1182e53c6..000000000 --- a/stdlib/_dummy_thread.pyi +++ /dev/null @@ -1,33 +0,0 @@ -from collections.abc import Callable -from types import TracebackType -from typing import Any, NoReturn, overload -from typing_extensions import TypeVarTuple, Unpack - -__all__ = ["error", "start_new_thread", "exit", "get_ident", "allocate_lock", "interrupt_main", "LockType", "RLock"] - -_Ts = TypeVarTuple("_Ts") - -TIMEOUT_MAX: int -error = RuntimeError - -@overload -def start_new_thread(function: Callable[[Unpack[_Ts]], object], args: tuple[Unpack[_Ts]]) -> None: ... -@overload -def start_new_thread(function: Callable[..., object], args: tuple[Any, ...], kwargs: dict[str, Any]) -> None: ... -def exit() -> NoReturn: ... -def get_ident() -> int: ... -def allocate_lock() -> LockType: ... -def stack_size(size: int | None = None) -> int: ... - -class LockType: - locked_status: bool - def acquire(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... - def __enter__(self, waitflag: bool | None = None, timeout: int = -1) -> bool: ... - def __exit__(self, typ: type[BaseException] | None, val: BaseException | None, tb: TracebackType | None) -> None: ... - def release(self) -> bool: ... - def locked(self) -> bool: ... - -class RLock(LockType): - def release(self) -> None: ... # type: ignore[override] - -def interrupt_main() -> None: ... diff --git a/stdlib/_dummy_threading.pyi b/stdlib/_dummy_threading.pyi deleted file mode 100644 index 1b66fb414..000000000 --- a/stdlib/_dummy_threading.pyi +++ /dev/null @@ -1,56 +0,0 @@ -from _threading_local import local as local -from _typeshed import ProfileFunction, TraceFunction -from threading import ( - TIMEOUT_MAX as TIMEOUT_MAX, - Barrier as Barrier, - BoundedSemaphore as BoundedSemaphore, - BrokenBarrierError as BrokenBarrierError, - Condition as Condition, - Event as Event, - ExceptHookArgs as ExceptHookArgs, - Lock as Lock, - RLock as RLock, - Semaphore as Semaphore, - Thread as Thread, - ThreadError as ThreadError, - Timer as Timer, - _DummyThread as _DummyThread, - _RLock as _RLock, - excepthook as excepthook, -) - -__all__ = [ - "get_ident", - "active_count", - "Condition", - "current_thread", - "enumerate", - "main_thread", - "TIMEOUT_MAX", - "Event", - "Lock", - "RLock", - "Semaphore", - "BoundedSemaphore", - "Thread", - "Barrier", - "BrokenBarrierError", - "Timer", - "ThreadError", - "setprofile", - "settrace", - "local", - "stack_size", - "ExceptHookArgs", - "excepthook", -] - -def active_count() -> int: ... -def current_thread() -> Thread: ... -def currentThread() -> Thread: ... -def get_ident() -> int: ... -def enumerate() -> list[Thread]: ... -def main_thread() -> Thread: ... -def settrace(func: TraceFunction) -> None: ... -def setprofile(func: ProfileFunction | None) -> None: ... -def stack_size(size: int | None = None) -> int: ... diff --git a/stdlib/dummy_threading.pyi b/stdlib/dummy_threading.pyi deleted file mode 100644 index 757cb8d4b..000000000 --- a/stdlib/dummy_threading.pyi +++ /dev/null @@ -1,2 +0,0 @@ -from _dummy_threading import * -from _dummy_threading import __all__ as __all__