mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-06-14 11:39:44 +08:00
threading: __exit__ only returns None (#8298)
Fixes #8297 `threading.Lock.__exit__` is implemented in C and can only return None: https://github.com/python/cpython/blob/6cbb57f62d345d7a5d6aeb1b3b5d37a845344d5e/Modules/_threadmodule.c#L200 `threading.Condition.__exit__` returns whatever its lock's `__exit__` returns, but our type annotations indicate that the lock is always a `Lock` or an `_RLock`, and neither returns anything other than None.
This commit is contained in:
@@ -106,7 +106,7 @@ class Lock:
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
) -> None: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def locked(self) -> bool: ...
|
||||
@@ -125,7 +125,7 @@ class Condition:
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
|
||||
) -> bool | None: ...
|
||||
) -> None: ...
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def wait(self, timeout: float | None = ...) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user