From 70fee29cc2758326b823c0eb4e56fd93c980497f Mon Sep 17 00:00:00 2001 From: Guo Ci Date: Fri, 14 Nov 2025 15:39:18 -0500 Subject: [PATCH] [stdlib][threading] Add `threading.__excepthook__` (#15023) --- stdlib/threading.pyi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index 28fa5267a..7b0f15bdf 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -1,6 +1,6 @@ import _thread import sys -from _thread import _excepthook, _ExceptHookArgs, get_native_id as get_native_id +from _thread import _ExceptHookArgs, get_native_id as get_native_id from _typeshed import ProfileFunction, TraceFunction from collections.abc import Callable, Iterable, Mapping from contextvars import ContextVar @@ -169,7 +169,9 @@ class Event: def clear(self) -> None: ... def wait(self, timeout: float | None = None) -> bool: ... -excepthook = _excepthook +excepthook: Callable[[_ExceptHookArgs], object] +if sys.version_info >= (3, 10): + __excepthook__: Callable[[_ExceptHookArgs], object] ExceptHookArgs = _ExceptHookArgs class Timer(Thread):