]> granicus.if.org Git - python/commitdiff
Issue #28915: Use _PyObject_CallNoArg()
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 11:29:18 +0000 (12:29 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 9 Dec 2016 11:29:18 +0000 (12:29 +0100)
Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func).

Modules/_ctypes/callbacks.c
Modules/_sqlite/connection.c

index 2c57d6b63930ffb05fdf42334cc43d1a9994284f..a11ae047638b5b453b9b1d52dcb9ce6a35b077d5 100644 (file)
@@ -535,7 +535,7 @@ long Call_CanUnloadNow(void)
         return E_FAIL;
     }
 
-    result = PyObject_CallFunction(func, NULL);
+    result = _PyObject_CallNoArg(func);
     Py_DECREF(func);
     if (!result) {
         PyErr_WriteUnraisable(context ? context : Py_None);
index 4cd3cb3e0502bb00ec9a67a15503e441688ecf8d..7bbc15c0214977ee895e1e5c35647be6d0d8c7c7 100644 (file)
@@ -645,7 +645,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_
     aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*));
 
     if (*aggregate_instance == 0) {
-        *aggregate_instance = PyObject_CallFunction(aggregate_class, NULL);
+        *aggregate_instance = _PyObject_CallNoArg(aggregate_class);
 
         if (PyErr_Occurred()) {
             *aggregate_instance = 0;
@@ -933,7 +933,7 @@ static int _progress_handler(void* user_arg)
 
     gilstate = PyGILState_Ensure();
 #endif
-    ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
+    ret = _PyObject_CallNoArg((PyObject*)user_arg);
 
     if (!ret) {
         if (_enable_callback_tracebacks) {