From a6897ec45c860dc78396987886e075e3d632b0c5 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 20 Dec 2024 16:11:54 +0000 Subject: [PATCH] Fix tests so they work on big-endian architectures --- tests/test_pyaudioop.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_pyaudioop.py b/tests/test_pyaudioop.py index f14057c..0541490 100644 --- a/tests/test_pyaudioop.py +++ b/tests/test_pyaudioop.py @@ -1,15 +1,14 @@ -import sys - from voip_utils import pyaudioop +byteorder = "little" def pack(width, data): - return b"".join(v.to_bytes(width, sys.byteorder, signed=True) for v in data) + return b"".join(v.to_bytes(width, byteorder, signed=True) for v in data) def unpack(width, data): return [ - int.from_bytes(data[i : i + width], sys.byteorder, signed=True) + int.from_bytes(data[i : i + width], byteorder, signed=True) for i in range(0, len(data), width) ]