@@ -815,17 +815,15 @@ final_callback(sqlite3_context *context)
815
815
Py_DECREF (function_result );
816
816
}
817
817
if (!ok ) {
818
- const char * attr_msg = "user-defined aggregate's 'finalize' method "
819
- "not defined" ;
820
- const char * err_msg = "user-defined aggregate's 'finalize' method "
821
- "raised error" ;
822
818
int attr_err = PyErr_ExceptionMatches (PyExc_AttributeError );
823
819
_PyErr_ChainExceptions (exception , value , tb );
824
820
825
821
/* Note: contrary to the step, value, and inverse callbacks, SQLite
826
822
* does not, as of SQLite 3.38.0, propagate errors to sqlite3_step()
827
823
* from the finalize callback. */
828
- set_sqlite_error (context , attr_err ? attr_msg : err_msg );
824
+ set_sqlite_error (context , attr_err
825
+ ? "user-defined aggregate's 'finalize' method not defined"
826
+ : "user-defined aggregate's 'finalize' method raised error" );
829
827
}
830
828
else {
831
829
PyErr_Restore (exception , value , tb );
@@ -1048,12 +1046,10 @@ value_callback(sqlite3_context *context)
1048
1046
1049
1047
PyObject * res = PyObject_CallMethodNoArgs (* cls , ctx -> state -> str_value );
1050
1048
if (res == NULL ) {
1051
- const char * attr_msg = "user-defined aggregate's 'value' method "
1052
- "not defined" ;
1053
- const char * err_msg = "user-defined aggregate's 'value' method "
1054
- "raised error" ;
1055
1049
int attr_err = PyErr_ExceptionMatches (PyExc_AttributeError );
1056
- set_sqlite_error (context , attr_err ? attr_msg : err_msg );
1050
+ set_sqlite_error (context , attr_err
1051
+ ? "user-defined aggregate's 'value' method not defined"
1052
+ : "user-defined aggregate's 'value' method raised error" );
1057
1053
}
1058
1054
else {
1059
1055
int rc = _pysqlite_set_result (context , res );
0 commit comments