From 0bad0691beb0473a208312489fb37cd7c288cbd1 Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:11:54 -0800 Subject: [PATCH] threading: fixes for _DummyThread and _RLock (#6437) Co-authored-by: hauntsaninja <> --- stdlib/threading.pyi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/stdlib/threading.pyi b/stdlib/threading.pyi index bbd131982..2c448ff3a 100644 --- a/stdlib/threading.pyi +++ b/stdlib/threading.pyi @@ -66,7 +66,8 @@ class Thread: def isDaemon(self) -> bool: ... def setDaemon(self, daemonic: bool) -> None: ... -class _DummyThread(Thread): ... +class _DummyThread(Thread): + def __init__(self) -> None: ... class Lock: def __init__(self) -> None: ... @@ -80,12 +81,12 @@ class Lock: class _RLock: def __init__(self) -> None: ... - def __enter__(self) -> bool: ... + def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... + def release(self) -> None: ... + __enter__ = acquire def __exit__( self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None ) -> bool | None: ... - def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ... - def release(self) -> None: ... RLock = _RLock