gh-91353: Fix void return type handling in ctypes (GH-32246) by hoodmane · Pull Request #32246 · python/cpython

@hoodmane

_ctypes_get_ffi_type never returns ffi_type_void. If the
return type is specified as None, we need set the libffi
return type to void, but just taking the output from
_ctypes_get_ffi_type will make the return type be sint.

This fixes two spots where ctypes accidentally converts
None return type to sint rather than void, causing crashes
on Emscripten targets.

@hoodmane

@hoodmane

tiran

@hoodmane

@ambv ambv changed the title bpo-47197: Fix void return type handling in ctypes gh-91353: Fix void return type handling in ctypes

Apr 14, 2022

@tiran tiran changed the title gh-91353: Fix void return type handling in ctypes gh-91353: Fix void return type handling in ctypes (GH-32246)

Apr 14, 2022

@hoodmane hoodmane mannequin mentioned this pull request

Jul 12, 2022