summaryrefslogtreecommitdiff
path: root/Modules/_ctypes/_ctypes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_ctypes/_ctypes.c')
-rw-r--r--Modules/_ctypes/_ctypes.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 01fccca83e..5cf2b8bb67 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -2983,10 +2983,9 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob)
"restype must be a type, a callable, or None");
return -1;
}
- Py_XDECREF(self->checker);
Py_INCREF(ob);
Py_SETREF(self->restype, ob);
- self->checker = PyObject_GetAttrString(ob, "_check_retval_");
+ Py_SETREF(self->checker, PyObject_GetAttrString(ob, "_check_retval_"));
if (self->checker == NULL)
PyErr_Clear();
return 0;