diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index fda33b248..67586efaf 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -119,7 +119,7 @@ class Image: @property def size(self) -> tuple[int, int]: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__(self, *args: object) -> None: ... def close(self) -> None: ... def __eq__(self, other: object) -> bool: ... def __array__(self, dtype=...) -> Any: ... # returns numpy.array() diff --git a/stubs/Pillow/PIL/ImageFile.pyi b/stubs/Pillow/PIL/ImageFile.pyi index 44560903a..d6f359bbe 100644 --- a/stubs/Pillow/PIL/ImageFile.pyi +++ b/stubs/Pillow/PIL/ImageFile.pyi @@ -41,7 +41,7 @@ class Parser: decode: Any def feed(self, data) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__(self, *args: object) -> None: ... def close(self) -> Image: ... class PyCodecState: diff --git a/stubs/PyMySQL/pymysql/cursors.pyi b/stubs/PyMySQL/pymysql/cursors.pyi index 23911f0d5..6e43797a3 100644 --- a/stubs/PyMySQL/pymysql/cursors.pyi +++ b/stubs/PyMySQL/pymysql/cursors.pyi @@ -24,7 +24,7 @@ class Cursor: def callproc(self, procname: Text, args: Iterable[Any] = ...) -> Any: ... def scroll(self, value: int, mode: Text = ...) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *exc_info: Any) -> None: ... + def __exit__(self, *exc_info: object) -> None: ... # Methods returning result tuples are below. def fetchone(self) -> tuple[Any, ...] | None: ... def fetchmany(self, size: int | None = ...) -> tuple[tuple[Any, ...], ...]: ... diff --git a/stubs/colorama/colorama/ansitowin32.pyi b/stubs/colorama/colorama/ansitowin32.pyi index e6474d870..ba1ba3e00 100644 --- a/stubs/colorama/colorama/ansitowin32.pyi +++ b/stubs/colorama/colorama/ansitowin32.pyi @@ -1,5 +1,6 @@ import sys from _typeshed import SupportsWrite +from types import TracebackType from typing import Any, Callable, Pattern, Sequence, TextIO, Union if sys.platform == "win32": @@ -13,7 +14,9 @@ class StreamWrapper: def __init__(self, wrapped: TextIO, converter: SupportsWrite[str]) -> None: ... def __getattr__(self, name: str) -> Any: ... def __enter__(self, *args: object, **kwargs: object) -> TextIO: ... - def __exit__(self, *args: Any, **kwargs: Any) -> None: ... + def __exit__( + self, __t: type[BaseException] | None, __value: BaseException | None, __traceback: TracebackType | None, **kwargs: Any + ) -> None: ... def write(self, text: str) -> None: ... def isatty(self) -> bool: ... @property diff --git a/stubs/freezegun/freezegun/api.pyi b/stubs/freezegun/freezegun/api.pyi index fb11594ed..6efe819ad 100644 --- a/stubs/freezegun/freezegun/api.pyi +++ b/stubs/freezegun/freezegun/api.pyi @@ -41,7 +41,7 @@ class _freeze_time: @overload def __call__(self, func: Callable[..., _T]) -> Callable[..., _T]: ... def __enter__(self) -> FrozenDateTimeFactory | StepTickTimeFactory: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__(self, *args: object) -> None: ... def start(self) -> Any: ... def stop(self) -> None: ... def decorate_class(self, klass: type[_T]) -> _T: ... diff --git a/stubs/humanfriendly/humanfriendly/__init__.pyi b/stubs/humanfriendly/humanfriendly/__init__.pyi index 6630b1a4a..40659454f 100644 --- a/stubs/humanfriendly/humanfriendly/__init__.pyi +++ b/stubs/humanfriendly/humanfriendly/__init__.pyi @@ -1,4 +1,5 @@ import datetime +from types import TracebackType from typing import Any, NamedTuple, Pattern class SizeUnit(NamedTuple): @@ -36,7 +37,12 @@ class Timer: total_time: float def __init__(self, start_time: Any | None = ..., resumable: bool = ...) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... + def __exit__( + self, + exc_type: type[BaseException] | None = ..., + exc_value: BaseException | None = ..., + traceback: TracebackType | None = ..., + ) -> None: ... def sleep(self, seconds: float) -> None: ... @property def elapsed_time(self): ... diff --git a/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi b/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi index 091ac7c27..d0b7d5ca6 100644 --- a/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi +++ b/stubs/humanfriendly/humanfriendly/terminal/spinners.pyi @@ -1,3 +1,4 @@ +from types import TracebackType from typing import Any GLYPHS: Any @@ -18,7 +19,12 @@ class Spinner: def sleep(self) -> None: ... def clear(self) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... + def __exit__( + self, + exc_type: type[BaseException] | None = ..., + exc_value: BaseException | None = ..., + traceback: TracebackType | None = ..., + ) -> None: ... class AutomaticSpinner: label: Any @@ -27,4 +33,9 @@ class AutomaticSpinner: subprocess: Any def __init__(self, label, show_time: bool = ...) -> None: ... def __enter__(self) -> None: ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... + def __exit__( + self, + exc_type: type[BaseException] | None = ..., + exc_value: BaseException | None = ..., + traceback: TracebackType | None = ..., + ) -> None: ... diff --git a/stubs/humanfriendly/humanfriendly/testing.pyi b/stubs/humanfriendly/humanfriendly/testing.pyi index 8da7c3178..f3f9fa861 100644 --- a/stubs/humanfriendly/humanfriendly/testing.pyi +++ b/stubs/humanfriendly/humanfriendly/testing.pyi @@ -1,4 +1,5 @@ import unittest +from types import TracebackType from typing import Any from humanfriendly.compat import StringIO @@ -14,7 +15,12 @@ class CallableTimedOut(Exception): ... class ContextManager: def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... + def __exit__( + self, + exc_type: type[BaseException] | None = ..., + exc_value: BaseException | None = ..., + traceback: TracebackType | None = ..., + ) -> None: ... class PatchedAttribute(ContextManager): object_to_patch: Any @@ -23,7 +29,6 @@ class PatchedAttribute(ContextManager): original_value: Any def __init__(self, obj, name, value) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... class PatchedItem(ContextManager): object_to_patch: Any @@ -32,27 +37,23 @@ class PatchedItem(ContextManager): original_value: Any def __init__(self, obj, item, value) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... class TemporaryDirectory(ContextManager): mkdtemp_options: Any temporary_directory: Any def __init__(self, **options) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... class MockedHomeDirectory(PatchedItem, TemporaryDirectory): def __init__(self) -> None: ... patched_value: Any def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... class CustomSearchPath(PatchedItem, TemporaryDirectory): isolated_search_path: Any def __init__(self, isolated: bool = ...) -> None: ... patched_value: Any def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... @property def current_search_path(self): ... @@ -72,7 +73,6 @@ class CaptureOutput(ContextManager): patched_attributes: Any def __init__(self, merged: bool = ..., input: str = ..., enabled: bool = ...) -> None: ... def __enter__(self): ... - def __exit__(self, exc_type: Any | None = ..., exc_value: Any | None = ..., traceback: Any | None = ...) -> None: ... def get_lines(self): ... def get_text(self): ... def getvalue(self): ... diff --git a/stubs/mock/mock/mock.pyi b/stubs/mock/mock/mock.pyi index 4dc268248..87802a55e 100644 --- a/stubs/mock/mock/mock.pyi +++ b/stubs/mock/mock/mock.pyi @@ -1,5 +1,6 @@ from _typeshed import Self from collections.abc import Callable, Mapping, Sequence +from types import TracebackType from typing import Any, Generic, TypeVar, overload from typing_extensions import Literal @@ -163,7 +164,9 @@ class _patch(Generic[_T]): temp_original: Any is_local: bool def __enter__(self) -> _T: ... - def __exit__(self, *exc_info: Any) -> None: ... + def __exit__( + self, __exc_type: type[BaseException] | None, __exc_value: BaseException | None, __traceback: TracebackType | None + ) -> None: ... def start(self) -> _T: ... def stop(self) -> None: ... @@ -175,7 +178,7 @@ class _patch_dict: def __call__(self, f: Any) -> Any: ... def decorate_class(self, klass: Any) -> Any: ... def __enter__(self) -> Any: ... - def __exit__(self, *args: Any) -> Any: ... + def __exit__(self, *args: object) -> Any: ... start: Any stop: Any diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 417d00ac3..4996c3b37 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -61,7 +61,9 @@ class Events(Generic[_T, _AbstractListener_T]): start: Callable[[], None] def __init__(self, *args: Any, **kwargs: Any) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None + ) -> None: ... def __iter__(self: Self) -> Self: ... def __next__(self) -> _T: ... def get(self, timeout: float | None = ...) -> _T | None: ... diff --git a/stubs/redis/redis/client.pyi b/stubs/redis/redis/client.pyi index 5660f6b78..83345c0b5 100644 --- a/stubs/redis/redis/client.pyi +++ b/stubs/redis/redis/client.pyi @@ -1,6 +1,7 @@ import threading from _typeshed import Self, SupportsItems from datetime import datetime, timedelta +from types import TracebackType from typing import Any, Callable, ClassVar, Generic, Iterable, Iterator, Mapping, Pattern, Sequence, TypeVar, overload from typing_extensions import Literal @@ -320,7 +321,9 @@ class PubSub: self, connection_pool, shard_hint: Any | None = ..., ignore_subscribe_messages: bool = ..., encoder: Any | None = ... ) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: ... + def __exit__( + self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None + ) -> None: ... def __del__(self): ... channels: Any patterns: Any @@ -698,6 +701,6 @@ class Monitor: monitor_re: Pattern[str] def __init__(self, connection_pool) -> None: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__(self, *args: object) -> None: ... def next_command(self) -> dict[str, Any]: ... def listen(self) -> Iterable[dict[str, Any]]: ... diff --git a/stubs/requests/requests/models.pyi b/stubs/requests/requests/models.pyi index d3d0a4b39..f656ccf57 100644 --- a/stubs/requests/requests/models.pyi +++ b/stubs/requests/requests/models.pyi @@ -108,7 +108,7 @@ class Response: def __nonzero__(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... def __enter__(self: Self) -> Self: ... - def __exit__(self, *args: Any) -> None: ... + def __exit__(self, *args: object) -> None: ... @property def next(self) -> PreparedRequest | None: ... @property