Skip to content

Commit 70fee29

Browse files
authored
[stdlib][threading] Add threading.__excepthook__ (#15023)
1 parent c453da9 commit 70fee29

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/threading.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _thread
22
import sys
3-
from _thread import _excepthook, _ExceptHookArgs, get_native_id as get_native_id
3+
from _thread import _ExceptHookArgs, get_native_id as get_native_id
44
from _typeshed import ProfileFunction, TraceFunction
55
from collections.abc import Callable, Iterable, Mapping
66
from contextvars import ContextVar
@@ -169,7 +169,9 @@ class Event:
169169
def clear(self) -> None: ...
170170
def wait(self, timeout: float | None = None) -> bool: ...
171171

172-
excepthook = _excepthook
172+
excepthook: Callable[[_ExceptHookArgs], object]
173+
if sys.version_info >= (3, 10):
174+
__excepthook__: Callable[[_ExceptHookArgs], object]
173175
ExceptHookArgs = _ExceptHookArgs
174176

175177
class Timer(Thread):

0 commit comments

Comments
 (0)