diff --git a/tools/python/apixml2python/linphone.py b/tools/python/apixml2python/linphone.py index 5c22e63c9..0825d8d62 100644 --- a/tools/python/apixml2python/linphone.py +++ b/tools/python/apixml2python/linphone.py @@ -770,9 +770,8 @@ class EventCallbackMethodDefinition(MethodDefinition): """ {get_user_data_code} if (py{name} == NULL) {{ {new_from_native_pointer_code} - }} else {{ - Py_INCREF(py{name}); }} + Py_INCREF(py{name}); """.format(name=arg_name, get_user_data_code=get_user_data_code, new_from_native_pointer_code=new_from_native_pointer_code) decref_python_objects_code += "\t\tPy_DECREF(py{name});\n".format(name=arg_name) args=', '.join(args)