diff --git a/tests/text_utils_test.py b/tests/text_utils_test.py index 027a7e6d2..e2bdb82c5 100644 --- a/tests/text_utils_test.py +++ b/tests/text_utils_test.py @@ -171,7 +171,13 @@ def test_uint32ToBytes(self): with self.assertRaises(struct.error) as ctx: f(-1) - self.assertEqual(str(ctx.exception), "argument out of range") + if sys.version_info >= (3, 12): + self.assertEqual( + str(ctx.exception), + "'I' format requires 0 <= number <= 4294967295", + ) + else: + self.assertEqual(str(ctx.exception), "argument out of range") def test_uint32FromBytes(self): f = uint32FromBytes