[Python-checkins] cpython: Issue #28915: Use _PyObject_CallNoArg()

victor.stinner python-checkins at python.org
Fri Dec 9 08:43:17 EST 2016


https://hg.python.org/cpython/rev/39bed12135c1
changeset:   105546:39bed12135c1
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Dec 09 12:29:18 2016 +0100
summary:
  Issue #28915: Use _PyObject_CallNoArg()

Replace PyObject_CallFunction(func, NULL) with _PyObject_CallNoArg(func).

files:
  Modules/_ctypes/callbacks.c  |  2 +-
  Modules/_sqlite/connection.c |  4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -535,7 +535,7 @@
         return E_FAIL;
     }
 
-    result = PyObject_CallFunction(func, NULL);
+    result = _PyObject_CallNoArg(func);
     Py_DECREF(func);
     if (!result) {
         PyErr_WriteUnraisable(context ? context : Py_None);
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -645,7 +645,7 @@
     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 @@
 
     gilstate = PyGILState_Ensure();
 #endif
-    ret = PyObject_CallFunction((PyObject*)user_arg, NULL);
+    ret = _PyObject_CallNoArg((PyObject*)user_arg);
 
     if (!ret) {
         if (_enable_callback_tracebacks) {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list