Skip to content

Commit 39cc479

Browse files
committed
add test and news
Signed-off-by: Manjusaka <[email protected]>
1 parent e3c2b67 commit 39cc479

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

Lib/test/test_ctypes/test_funcptr.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ def c_string(init):
130130
def test_abstract(self):
131131
self.assertRaises(TypeError, _CFuncPtr, 13, "name", 42, "iid")
132132

133+
def test_invalid_argtypes(self):
134+
libc = CDLL(None)
135+
136+
PRINTF_PROTO = CFUNCTYPE(c_int, ctypes.c_char_p)
137+
c_printf = PRINTF_PROTO(("printf", libc), ((1,),))
138+
c_printf.argtypes = (c_char_p, c_int)
139+
with self.assertRaises(TypeError):
140+
c_printf(b"Hello\n")
133141

134142
if __name__ == '__main__':
135143
unittest.main()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix segfaults in _cyptes during _build_callargs.

0 commit comments

Comments
 (0)