Skip to content

Commit

Permalink
fix: cython3 compat (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jul 24, 2023
1 parent b03660f commit 43b3d48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dbus_fast/_private/unmarshaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
}

_SignatureType = SignatureType
_int = int

READER_TYPE = Callable[["Unmarshaller", SignatureType], Any]

Expand Down Expand Up @@ -245,7 +246,7 @@ def message(self) -> Optional[Message]:
"""Return the message that has been unmarshalled."""
return self._message

def _read_sock(self, length: int) -> bytes:
def _read_sock(self, length: _int) -> bytes:
"""reads from the socket, storing any fds sent and handling errors
from the read itself"""
# This will raise BlockingIOError if there is no data to read
Expand All @@ -263,7 +264,7 @@ def _read_sock(self, length: int) -> bytes:

return msg

def _read_to_pos(self, pos: int) -> None:
def _read_to_pos(self, pos: _int) -> None:
"""
Read from underlying socket into buffer.
Expand Down Expand Up @@ -497,7 +498,7 @@ def _read_array(self, type_: _SignatureType) -> Iterable[Any]:
result_list.append(reader(self, child_type))
return result_list

def _header_fields(self, header_length: int) -> Dict[str, Any]:
def _header_fields(self, header_length: _int) -> Dict[str, Any]:
"""Header fields are always a(yv)."""
beginning_pos = self._pos
headers = {}
Expand Down

0 comments on commit 43b3d48

Please sign in to comment.