mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Change TemporaryFileWrapper.__exit__ return type to None (#7470)
For context we found this from quora/pyanalyze#496, which makes pyanalyze stricter about context managers that may swallow exceptions. tempfile._TemporaryFileWrapper.__exit__ returns whatever its underlying file returns (https://github.com/python/cpython/blob/3.6/Lib/tempfile.py#L502), and file objects don't tend to return anything from __exit__.
This commit is contained in:
@@ -185,7 +185,7 @@ class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]):
|
||||
delete: bool
|
||||
def __init__(self, file: IO[AnyStr], name: str, delete: bool = ...) -> None: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> bool | None: ...
|
||||
def __exit__(self, exc: type[BaseException] | None, value: BaseException | None, tb: TracebackType | None) -> None: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def close(self) -> None: ...
|
||||
# These methods don't exist directly on this object, but
|
||||
|
||||
Reference in New Issue
Block a user