SIGN IN SIGN UP

bpo-46323: _ctypes.CFuncPtr fails if _argtypes_ is too long (GH-31188)

ctypes.CFUNCTYPE() and ctypes.WINFUNCTYPE() now fail to create the
type if its "_argtypes_" member contains too many arguments.
Previously, the error was only raised when calling a function.

Change also how CFUNCTYPE() and WINFUNCTYPE() handle KeyError to
prevent creating a chain of exceptions if ctypes.CFuncPtr raises an
error.
V
Victor Stinner committed
4cce1352bb47babaeefb68fcfcc48ffa073745c3
Parent: 8e98175
Committed by GitHub <noreply@github.com> on 2/7/2022, 1:53:15 PM