We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08bdada commit 8505d4bCopy full SHA for 8505d4b
Lib/test/test_ctypes/test_pointers.py
@@ -287,10 +287,16 @@ def test_pointer_set_type_twice(self):
287
self.assertIs(t1._type_, c_int)
288
289
def test_pointer_set_wrong_type(self):
290
+ class C(c_int):
291
+ pass
292
+
293
t1 = POINTER(c_int)
294
with self.assertRaisesRegex(TypeError, "pointer type already set"):
295
t1.set_type(c_float)
296
297
+ with self.assertRaisesRegex(TypeError, "cls type already set"):
298
+ t1.set_type(C)
299
300
def test_pointer_not_ctypes_type(self):
301
with self.assertRaisesRegex(TypeError, "must have storage info"):
302
POINTER(int)
0 commit comments