mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 07:21:56 +08:00
Fix BaseConnectionWrapper.execute_wrapper (#752)
This is a context manager, not an iterator. Currently mypy will complain if it's used as documented.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from datetime import tzinfo
|
from datetime import tzinfo
|
||||||
from typing import Any, Callable, Dict, Iterator, List, Optional, Type, TypeVar
|
from typing import Any, Callable, ContextManager, Dict, Iterator, List, Optional, Type, TypeVar
|
||||||
|
|
||||||
from django.db.backends.base.client import BaseDatabaseClient
|
from django.db.backends.base.client import BaseDatabaseClient
|
||||||
from django.db.backends.base.creation import BaseDatabaseCreation
|
from django.db.backends.base.creation import BaseDatabaseCreation
|
||||||
@@ -98,5 +98,5 @@ class BaseDatabaseWrapper:
|
|||||||
def schema_editor(self, *args: Any, **kwargs: Any) -> BaseDatabaseSchemaEditor: ...
|
def schema_editor(self, *args: Any, **kwargs: Any) -> BaseDatabaseSchemaEditor: ...
|
||||||
def on_commit(self, func: Callable[[], None]) -> None: ...
|
def on_commit(self, func: Callable[[], None]) -> None: ...
|
||||||
def run_and_clear_commit_hooks(self) -> None: ...
|
def run_and_clear_commit_hooks(self) -> None: ...
|
||||||
def execute_wrapper(self, wrapper: _ExecuteWrapper) -> Iterator[None]: ...
|
def execute_wrapper(self, wrapper: _ExecuteWrapper) -> ContextManager[None]: ...
|
||||||
def copy(self: _T, alias: Optional[str] = ...) -> _T: ...
|
def copy(self: _T, alias: Optional[str] = ...) -> _T: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user