summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-10-12 06:38:19 (GMT)
committerGitHub <noreply@github.com>2021-10-12 06:38:19 (GMT)
commitd943d19172aa93ce88bade15b9f23a0ce3bc72ff (patch)
treec674b910e203113b991861de5b12e2ab79eb166b /Objects
parentbe21706f3760bec8bd11f85ce02ed6792b07f51f (diff)
downloadcpython-d943d19172aa93ce88bade15b9f23a0ce3bc72ff.zip
cpython-d943d19172aa93ce88bade15b9f23a0ce3bc72ff.tar.gz
cpython-d943d19172aa93ce88bade15b9f23a0ce3bc72ff.tar.bz2
bpo-45439: Move _PyObject_CallNoArgs() to pycore_call.h (GH-28895)
* Move _PyObject_CallNoArgs() to pycore_call.h (internal C API). * _ssl, _sqlite and _testcapi extensions now call the public PyObject_CallNoArgs() function, rather than _PyObject_CallNoArgs(). * _lsprof extension is now built with Py_BUILD_CORE_MODULE macro defined to get access to internal _PyObject_CallNoArgs().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c1
-rw-r--r--Objects/bytesobject.c1
-rw-r--r--Objects/complexobject.c1
-rw-r--r--Objects/dictobject.c15
-rw-r--r--Objects/enumobject.c1
-rw-r--r--Objects/fileobject.c3
-rw-r--r--Objects/genobject.c9
-rw-r--r--Objects/iterobject.c3
-rw-r--r--Objects/moduleobject.c1
-rw-r--r--Objects/object.c13
-rw-r--r--Objects/odictobject.c6
-rw-r--r--Objects/typeobject.c10
12 files changed, 37 insertions, 27 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 3312e26..0d6cefd 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2,6 +2,7 @@
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_object.h" // _Py_CheckSlotResult()
#include "pycore_pyerrors.h" // _PyErr_Occurred()
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 0dfded2..bc0b075 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -5,6 +5,7 @@
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_bytes_methods.h" // _Py_bytes_startswith()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_format.h" // F_LJUST
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_object.h" // _PyObject_GC_TRACK
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index ff8fcba..f658dbf 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -6,6 +6,7 @@
/* Submitted by Jim Hugunin */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_object.h" // _PyObject_Init()
#include "pycore_pymath.h" // _Py_ADJUST_ERANGE2()
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index f883ca7..60470bf 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -112,13 +112,14 @@ As a consequence of this, split keys have a maximum size of 16.
#define PyDict_MINSIZE 8
#include "Python.h"
-#include "pycore_bitutils.h" // _Py_bit_length
-#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED()
-#include "pycore_object.h" // _PyObject_GC_TRACK()
-#include "pycore_pyerrors.h" // _PyErr_Fetch()
-#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "pycore_dict.h"
-#include "stringlib/eq.h" // unicode_eq()
+#include "pycore_bitutils.h" // _Py_bit_length
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_dict.h" // PyDictKeysObject
+#include "pycore_gc.h" // _PyObject_GC_IS_TRACKED()
+#include "pycore_object.h" // _PyObject_GC_TRACK()
+#include "pycore_pyerrors.h" // _PyErr_Fetch()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "stringlib/eq.h" // unicode_eq()
/*[clinic input]
class dict "PyDictObject *" "&PyDict_Type"
diff --git a/Objects/enumobject.c b/Objects/enumobject.c
index aae7dff..4513831 100644
--- a/Objects/enumobject.c
+++ b/Objects/enumobject.c
@@ -1,6 +1,7 @@
/* enumerate object */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetOne()
#include "pycore_object.h" // _PyObject_GC_TRACK()
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 5cb017e8..dc600c6 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -2,7 +2,8 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-#include "pycore_runtime.h" // _PyRuntime
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_runtime.h" // _PyRuntime
#if defined(HAVE_GETC_UNLOCKED) && !defined(_Py_MEMORY_SANITIZER)
/* clang MemorySanitizer doesn't yet understand getc_unlocked. */
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 8fa04e8..f91f367 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -1,14 +1,15 @@
/* Generator object implementation */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _PyEval_EvalFrame()
-#include "pycore_object.h"
+#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "frameobject.h"
-#include "pycore_frame.h"
+#include "pycore_frame.h" // InterpreterFrame
+#include "frameobject.h" // PyFrameObject
#include "structmember.h" // PyMemberDef
-#include "opcode.h"
+#include "opcode.h" // YIELD_FROM
static PyObject *gen_close(PyGenObject *, PyObject *);
static PyObject *async_gen_asend_new(PyAsyncGenObject *, PyObject *);
diff --git a/Objects/iterobject.c b/Objects/iterobject.c
index acfc539..5db6bc1 100644
--- a/Objects/iterobject.c
+++ b/Objects/iterobject.c
@@ -1,7 +1,8 @@
/* Iterator objects */
#include "Python.h"
-#include "pycore_object.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_object.h" // _PyObject_GC_TRACK()
typedef struct {
PyObject_HEAD
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index f008995..1d649a7 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -2,6 +2,7 @@
/* Module object implementation */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_interp.h" // PyInterpreterState.importlib
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_moduleobject.h" // _PyModule_GetDef()
diff --git a/Objects/object.c b/Objects/object.c
index d269274..9d48346 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2,18 +2,19 @@
/* Generic object operations; and implementation of None */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
#include "pycore_context.h"
-#include "pycore_initconfig.h"
-#include "pycore_object.h"
-#include "pycore_pyerrors.h"
-#include "pycore_pylifecycle.h"
+#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
+#include "pycore_object.h" // _PyType_CheckConsistency()
+#include "pycore_pyerrors.h" // _PyErr_Occurred()
+#include "pycore_pylifecycle.h" // _PyTypes_InitSlotDefs()
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_symtable.h" // PySTEntry_Type
#include "pycore_unionobject.h" // _PyUnion_Type
-#include "frameobject.h"
-#include "interpreteridobject.h"
+#include "frameobject.h" // PyFrame_Type
+#include "interpreteridobject.h" // _PyInterpreterID_Type
#ifdef Py_LIMITED_API
// Prevent recursive call _Py_IncRef() <=> Py_INCREF()
diff --git a/Objects/odictobject.c b/Objects/odictobject.c
index 1462a3b..9af45c6 100644
--- a/Objects/odictobject.c
+++ b/Objects/odictobject.c
@@ -465,10 +465,10 @@ later:
*/
#include "Python.h"
-#include "pycore_object.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_object.h" // _PyObject_GC_UNTRACK()
+#include "pycore_dict.h" // _Py_dict_lookup()
#include <stddef.h> // offsetof()
-#include "pycore_dict.h"
-#include <stddef.h>
#include "clinic/odictobject.c.h"
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index a73a696..0f56e59 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -4,14 +4,14 @@
#include "pycore_call.h"
#include "pycore_code.h" // CO_FAST_FREE
#include "pycore_compile.h" // _Py_Mangle()
-#include "pycore_initconfig.h"
+#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_moduleobject.h" // _PyModule_GetDef()
-#include "pycore_object.h"
-#include "pycore_pyerrors.h"
+#include "pycore_object.h" // _PyType_HasFeature()
+#include "pycore_pyerrors.h" // _PyErr_Occurred()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_unionobject.h" // _Py_union_type_or
-#include "frameobject.h"
-#include "pycore_frame.h"
+#include "frameobject.h" // PyFrameObject
+#include "pycore_frame.h" // InterpreterFrame
#include "opcode.h" // MAKE_CELL
#include "structmember.h" // PyMemberDef