We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43cc3d8 commit afd67ebCopy full SHA for afd67eb
Modules/_ctypes/callbacks.c
@@ -178,15 +178,15 @@ static void _CallPythonObject(void *mem,
178
for (i = 0; i < n_args; i++) {
179
PyObject *cnv = cnvs[i];
180
StgDictObject *dict;
181
- if (cnv) {
182
- Py_INCREF(cnv);
183
- dict = PyType_stgdict(cnv);
184
- }
185
- else {
+
+ if (cnv == NULL) {
186
PrintError("Getting argument converter %zd\n", i);
187
goto Done;
188
}
189
+ Py_INCREF(cnv);
+ dict = PyType_stgdict(cnv);
190
if (dict && dict->getfunc && !_ctypes_simple_instance(cnv)) {
191
PyObject *v = dict->getfunc(*pArgs, dict->size);
192
if (!v) {
0 commit comments