From 30ce456c76ae973831ed43d4a92125ce06b32445 Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Thu, 12 Oct 2023 22:45:18 +0330 Subject: [PATCH] fix text_utils_test.py on Python 3.12 --- tests/text_utils_test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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