summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r--Lib/test/test_struct.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index ab73877..b0f11af 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -700,6 +700,20 @@ class StructTest(unittest.TestCase):
with self.assertRaises(TypeError):
cls.x = 1
+ @support.cpython_only
+ def test__struct_Struct__new__initialized(self):
+ # See https://github.com/python/cpython/issues/78724
+
+ s = struct.Struct.__new__(struct.Struct, "b")
+ s.unpack_from(b"abcd")
+
+ @support.cpython_only
+ def test__struct_Struct_subclassing(self):
+ class Bob(struct.Struct):
+ pass
+
+ s = Bob("b")
+ s.unpack_from(b"abcd")
def test_issue35714(self):
# Embedded null characters should not be allowed in format strings.