diff --git a/Lib/ctypes/test/test_structures.py b/Lib/ctypes/test/test_structures.py index 84d456c3cc3..e00bb046b44 100644 --- a/Lib/ctypes/test/test_structures.py +++ b/Lib/ctypes/test/test_structures.py @@ -326,11 +326,8 @@ class Person(Structure): cls, msg = self.get_except(Person, b"Someone", (b"a", b"b", b"c")) self.assertEqual(cls, RuntimeError) - if issubclass(Exception, object): - self.assertEqual(msg, - "(Phone) : too many initializers") - else: - self.assertEqual(msg, "(Phone) TypeError: too many initializers") + self.assertEqual(msg, + "(Phone) : too many initializers") def test_huge_field_name(self): # issue12881: segfault with large structure field names