mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
threading.Lock issue when using it with ExitStack (#2908)
* Make threading primitives ContextManagers * Make catch_warnings ContextManager * Make SMTP ContextManager * Fix type of exc_type for SMTP
This commit is contained in:
committed by
Sebastian Rittau
parent
b87064a274
commit
bec2fef7fa
@@ -80,7 +80,7 @@ class Lock:
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
if sys.version_info >= (3,):
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
@@ -94,7 +94,7 @@ class _RLock:
|
||||
def __init__(self) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
if sys.version_info >= (3,):
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
@@ -110,7 +110,7 @@ class Condition:
|
||||
def __init__(self, lock: Union[Lock, _RLock, None] = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
if sys.version_info >= (3,):
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
@@ -130,7 +130,7 @@ class Semaphore:
|
||||
def __init__(self, value: int = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
if sys.version_info >= (3,):
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
@@ -142,7 +142,7 @@ class BoundedSemaphore:
|
||||
def __init__(self, value: int = ...) -> None: ...
|
||||
def __enter__(self) -> bool: ...
|
||||
def __exit__(self, exc_type: Optional[Type[BaseException]],
|
||||
exc_val: Optional[Exception],
|
||||
exc_val: Optional[BaseException],
|
||||
exc_tb: Optional[TracebackType]) -> bool: ...
|
||||
if sys.version_info >= (3,):
|
||||
def acquire(self, blocking: bool = ..., timeout: float = ...) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user