Skip to content

Commit afd67eb

Browse files
committed
1 parent 43cc3d8 commit afd67eb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Modules/_ctypes/callbacks.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ static void _CallPythonObject(void *mem,
178178
for (i = 0; i < n_args; i++) {
179179
PyObject *cnv = cnvs[i];
180180
StgDictObject *dict;
181-
if (cnv) {
182-
Py_INCREF(cnv);
183-
dict = PyType_stgdict(cnv);
184-
}
185-
else {
181+
182+
if (cnv == NULL) {
186183
PrintError("Getting argument converter %zd\n", i);
187184
goto Done;
188185
}
189186

187+
Py_INCREF(cnv);
188+
dict = PyType_stgdict(cnv);
189+
190190
if (dict && dict->getfunc && !_ctypes_simple_instance(cnv)) {
191191
PyObject *v = dict->getfunc(*pArgs, dict->size);
192192
if (!v) {

0 commit comments

Comments
 (0)