bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)


If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad0452d94e66c964b625a0b61befa08e59)

Co-authored-by: Victor Stinner <vstinner@python.org>
6 files changed