Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make `transaction.atomic` compatible with `AbstractContextManager` protocol. Currently the following error is reported by pyright: ```python from contextlib import AbstractContextManager from django.db import transaction x: AbstractContextManager[None, None] = transaction.atomic() ``` ``` Type "Atomic" is not assignable to declared type "AbstractContextManager[None, None]" "Atomic" is incompatible with protocol "AbstractContextManager[None, None]" "__exit__" is an incompatible type Type "(exc_type: None, exc_value: None, traceback: None) -> None" is not assignable to type "(exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /) -> _ExitT_co@AbstractContextManager" Parameter 1: type "type[BaseException] | None" is incompatible with type "None" Type "type[BaseException] | None" is not assignable to type "None" Parameter 2: type "BaseException | None" is incompatible with type "None" Type "BaseException | None" is not assignable to type "None" Parameter 3: type "TracebackType | None" is incompatible with type "None" ```
- Loading branch information