Skip to content

Commit

Permalink
Add missing args.
Browse files Browse the repository at this point in the history
Byteorder and length are required for int.to_bytes() in py39 and 310.
  • Loading branch information
denpamusic committed Nov 9, 2023
1 parent 06ed94e commit f27b43a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyplumio/helpers/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class Byte(DataType):

def pack(self) -> bytes:
"""Pack the data."""
return self.value.to_bytes()
return self.value.to_bytes(length=self.size, byteorder="big")

def unpack(self, data: bytes) -> None:
"""Unpack the data."""
Expand All @@ -107,7 +107,7 @@ def next(self, index: int = 0) -> int:

def pack(self) -> bytes:
"""Pack the data."""
return self._value.to_bytes()
return self._value.to_bytes(length=1, byteorder="big")

def unpack(self, data: bytes) -> None:
"""Unpack the data."""
Expand Down

0 comments on commit f27b43a

Please sign in to comment.