Skip to content

Commit 070c4d7

Browse files
committed
Issue python#28915: Use _PyObject_CallNoArg()
Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func).
1 parent ec80ba4 commit 070c4d7

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Modules/_ctypes/callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ long Call_CanUnloadNow(void)
535535
return E_FAIL;
536536
}
537537

538-
result = PyObject_CallFunction(func, NULL);
538+
result = _PyObject_CallNoArg(func);
539539
Py_DECREF(func);
540540
if (!result) {
541541
PyErr_WriteUnraisable(context ? context : Py_None);

Modules/_sqlite/connection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
645645
aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
646646

647647
if (*aggregate_instance == 0) {
648-
*aggregate_instance = PyObject_CallFunction(aggregate_class, NULL);
648+
*aggregate_instance = _PyObject_CallNoArg(aggregate_class);
649649

650650
if (PyErr_Occurred()) {
651651
*aggregate_instance = 0;
@@ -933,7 +933,7 @@ static int _progress_handler(void* user_arg)
933933

934934
gilstate = PyGILState_Ensure();
935935
#endif
936-
ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
936+
ret = _PyObject_CallNoArg((PyObject*)user_arg);
937937

938938
if (!ret) {
939939
if (_enable_callback_tracebacks) {

0 commit comments

Comments
 (0)