function_result = _PyObject_CallMethodId(*aggregate_instance, &PyId_finalize, "");
- /* Restore the exception (if any) of the last call to step(),
- but clear also the current exception if finalize() failed */
- PyErr_Restore(exception, value, tb);
-
Py_DECREF(*aggregate_instance);
ok = 0;
_sqlite3_result_error(context, "user-defined aggregate's 'finalize' method raised error", -1);
}
+ /* Restore the exception (if any) of the last call to step(),
+ but clear also the current exception if finalize() failed */
+ PyErr_Restore(exception, value, tb);
+
error:
#ifdef WITH_THREAD
PyGILState_Release(threadstate);