summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2006-08-16 15:10:12 (GMT)
committerThomas Heller <theller@ctypes.org>2006-08-16 15:10:12 (GMT)
commitb4a0cf17c4f665162024f354ab0d3077d5c91a99 (patch)
treec5a0d66355edbea405a42e62aa5595ab423a04c1 /Modules
parentf9b5b8e9f8f16a2cf829e864017496727af73949 (diff)
downloadcpython-b4a0cf17c4f665162024f354ab0d3077d5c91a99.zip
cpython-b4a0cf17c4f665162024f354ab0d3077d5c91a99.tar.gz
cpython-b4a0cf17c4f665162024f354ab0d3077d5c91a99.tar.bz2
Remove the special casing of Py_None when converting the return value
of the Python part of a callback function to C. If it cannot be converted, call PyErr_WriteUnraisable with the exception we got. Before, arbitrary data has been passed to the calling C code in this case. (I'm not really sure the NEWS entry is understandable, but I cannot find better words)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/callbacks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index cbe3d03..c8e669a 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -205,7 +205,7 @@ if (x == NULL) _AddTraceback(what, __FILE__, __LINE__ - 1), PyErr_Print()
result = PyObject_CallObject(callable, arglist);
CHECK("'calling callback function'", result);
- if ((restype != &ffi_type_void) && result && result != Py_None) {
+ if ((restype != &ffi_type_void) && result) {
PyObject *keep;
assert(setfunc);
#ifdef WORDS_BIGENDIAN