diff --git a/pygit2/__init__.py b/pygit2/__init__.py index 7b01d37c..56d2d643 100644 --- a/pygit2/__init__.py +++ b/pygit2/__init__.py @@ -364,7 +364,7 @@ def init_repository( - path: str | bytes | os.PathLike | None, + path: str | bytes | os.PathLike[str] | os.PathLike[bytes] | None, bare: bool = False, flags: enums.RepositoryInitFlag = enums.RepositoryInitFlag.MKPATH, mode: int | enums.RepositoryInitMode = enums.RepositoryInitMode.SHARED_UMASK, @@ -444,8 +444,8 @@ def init_repository( def clone_repository( - url: str | bytes | os.PathLike, - path: str | bytes | os.PathLike, + url: str | bytes | os.PathLike[str] | os.PathLike[bytes], + path: str | bytes | os.PathLike[str] | os.PathLike[bytes], bare: bool = False, repository: typing.Callable | None = None, remote: typing.Callable | None = None, diff --git a/pygit2/_pygit2.pyi b/pygit2/_pygit2.pyi index 105acc2a..df4c3e26 100644 --- a/pygit2/_pygit2.pyi +++ b/pygit2/_pygit2.pyi @@ -763,7 +763,7 @@ class Repository: def references_iterator_init(self) -> Iterator[Reference]: ... def references_iterator_next( self, - iter: Iterator, + iter: Iterator[T], references_return_type: ReferenceFilter = ReferenceFilter.ALL, ) -> Reference: ... def reset(self, oid: _OidArg, reset_type: ResetMode) -> None: ... diff --git a/pygit2/utils.py b/pygit2/utils.py index b3d5d141..4e77d98f 100644 --- a/pygit2/utils.py +++ b/pygit2/utils.py @@ -53,7 +53,7 @@ def maybe_string(ptr: 'char_pointer | None') -> str | None: @overload def to_bytes( - s: str | bytes | os.PathLike[str], + s: str | bytes | os.PathLike[str] | os.PathLike[bytes], encoding: str = 'utf-8', errors: str = 'strict', ) -> bytes: ... @@ -64,7 +64,7 @@ def to_bytes( errors: str = 'strict', ) -> Union['ffi.NULL_TYPE']: ... def to_bytes( - s: Union[str, bytes, 'ffi.NULL_TYPE', os.PathLike[str], None], + s: Union[str, bytes, 'ffi.NULL_TYPE', os.PathLike[str], os.PathLike[bytes], None], encoding: str = 'utf-8', errors: str = 'strict', ) -> Union[bytes, 'ffi.NULL_TYPE']: