Use Generator instead of Iterator for 3rd-party context managers (#12481)

This commit is contained in:
Max Muoto
2024-08-12 07:26:18 -05:00
committed by GitHub
parent 0b6f15c2ff
commit 37807d753a
14 changed files with 22 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
import contextlib
import types
from _typeshed import StrOrBytesPath, StrPath
from collections.abc import Iterator
from collections.abc import Generator
from typing import Generic, TypeVar
from typing_extensions import TypeAlias
@@ -12,7 +12,7 @@ def to_bytes(s: _CDataBase | StrOrBytesPath | None, encoding: str = "utf-8", err
def to_str(s: StrOrBytesPath) -> str: ...
def ptr_to_bytes(ptr_cdata: _CDataBase) -> bytes: ...
@contextlib.contextmanager
def new_git_strarray() -> Iterator[_GitStrArray]: ...
def new_git_strarray() -> Generator[_GitStrArray]: ...
def strarray_to_strings(arr: _GitStrArray) -> list[str]: ...
# Actual type: _cffi_backend.__CDataOwn <cdata 'struct git_strarray *'>