Skip to content

Commit e894e1c

Browse files
committed
Merge remote-tracking branch 'kbaikov/mypy-fixes9'
2 parents 97255cc + ecd6ff2 commit e894e1c

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

pygit2/_libgit2/ffi.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ def new(a: Literal['git_buf *'], b: tuple[NULL_TYPE, Literal[0]]) -> GitBufC: ..
335335
@overload
336336
def new(a: Literal['char **']) -> _Pointer[char_pointer]: ...
337337
@overload
338+
def new(a: Literal['void **'], b: bytes) -> _Pointer[bytes]: ...
339+
@overload
338340
def new(a: Literal['char[]', 'char []'], b: bytes | NULL_TYPE) -> ArrayC[char]: ...
339341
@overload
340342
def new(

pygit2/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __del__(self) -> None:
110110
except AttributeError:
111111
pass
112112

113-
def _get(self, key: str | bytes) -> tuple[object, 'ConfigEntry']:
113+
def _get(self, key: str | bytes) -> tuple[int, 'ConfigEntry']:
114114
key = str_to_bytes(key, 'key')
115115

116116
entry = ffi.new('git_config_entry **')

pygit2/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
value_errors = set([C.GIT_EEXISTS, C.GIT_EINVALIDSPEC, C.GIT_EAMBIGUOUS])
3333

3434

35-
def check_error(err, io: bool = False) -> None:
35+
def check_error(err: int, io: bool = False) -> None:
3636
if err >= 0:
3737
return
3838

pygit2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def to_str(s: str | bytes | os.PathLike[str] | os.PathLike[bytes]) -> str:
9393
raise TypeError(f'unexpected type "{repr(s)}"')
9494

9595

96-
def ptr_to_bytes(ptr_cdata):
96+
def ptr_to_bytes(ptr_cdata) -> bytes:
9797
"""
9898
Convert a pointer coming from C code (<cdata 'some_type *'>)
9999
to a byte buffer containing the address that the pointer refers to.

0 commit comments

Comments
 (0)