* 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().
return _PyObject_FastCallTstate(tstate, func, args, nargs);
}
-/* Call a callable without any arguments
- Private static inline function variant of public function
- PyObject_CallNoArgs(). */
-static inline PyObject *
-_PyObject_CallNoArgs(PyObject *func) {
- PyThreadState *tstate = PyThreadState_Get();
- return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
-}
-
static inline PyObject *
PyObject_CallOneArg(PyObject *func, PyObject *arg)
{
return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
}
+// Private static inline function variant of public PyObject_CallNoArgs()
+static inline PyObject *
+_PyObject_CallNoArgs(PyObject *func) {
+ PyThreadState *tstate = PyThreadState_Get();
+ return _PyObject_VectorcallTstate(tstate, func, NULL, 0, NULL);
+}
+
#ifdef __cplusplus
}
#endif
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
#include "structmember.h" // PyMemberDef
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "structmember.h" // PyMemberDef
#include <ffi.h>
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "frameobject.h"
#include <stdbool.h>
#include "Python.h"
#include "pycore_bitutils.h" // _Py_bswap32()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include <ffi.h>
#ifdef MS_WIN32
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include <ffi.h>
#ifdef MS_WIN32
#include <windows.h>
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_object.h" // _PyObject_GC_TRACK
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_object.h"
#include "structmember.h" // PyMemberDef
#include "_iomodule.h"
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "rotatingtree.h"
/************************************************************/
if (*aggregate_instance == NULL) {
callback_context *ctx = (callback_context *)sqlite3_user_data(context);
assert(ctx != NULL);
- *aggregate_instance = _PyObject_CallNoArgs(ctx->callable);
+ *aggregate_instance = PyObject_CallNoArgs(ctx->callable);
if (!*aggregate_instance) {
set_sqlite_error(context,
"user-defined aggregate's '__init__' method raised error");
assert(ctx != NULL);
PyObject *callable = ((callback_context *)ctx)->callable;
- ret = _PyObject_CallNoArgs(callable);
+ ret = PyObject_CallNoArgs(callable);
if (!ret) {
/* abort query if error occurred */
rc = -1;
}
if (pw_info->callable) {
- fn_ret = _PyObject_CallNoArgs(pw_info->callable);
+ fn_ret = PyObject_CallNoArgs(pw_info->callable);
if (!fn_ret) {
/* TODO: It would be nice to move _ctypes_add_traceback() into the
core python API, so we could use it to add a frame here */
PyObject *rc;
int success;
PyGILState_STATE s = PyGILState_Ensure();
- rc = _PyObject_CallNoArgs((PyObject *)callable);
+ rc = PyObject_CallNoArgs((PyObject *)callable);
success = (rc != NULL);
Py_XDECREF(rc);
PyGILState_Release(s);
{
/* we assume the argument is callable object to which we own a reference */
PyObject *callable = (PyObject *)arg;
- PyObject *r = _PyObject_CallNoArgs(callable);
+ PyObject *r = PyObject_CallNoArgs(callable);
Py_DECREF(callable);
Py_XDECREF(r);
return r != NULL ? 0 : -1;
/* Execute __del__ method, if any. */
del = _PyObject_LookupSpecial(self, &PyId___tp_del__);
if (del != NULL) {
- res = _PyObject_CallNoArgs(del);
+ res = PyObject_CallNoArgs(del);
if (res == NULL)
PyErr_WriteUnraisable(del);
else
/* Allocate a Python thread state for this thread */
state = PyGILState_Ensure();
- res = _PyObject_CallNoArgs(test_c_thread->callback);
+ res = PyObject_CallNoArgs(test_c_thread->callback);
Py_CLEAR(test_c_thread->callback);
if (res == NULL) {
#ifdef _Py_ADDRESS_SANITIZER
Py_RETURN_NONE;
#else
- PyObject *op = _PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
+ PyObject *op = PyObject_CallNoArgs((PyObject *)&PyBaseObject_Type);
if (op == NULL) {
return NULL;
}
return NULL;
}
- PyObject *res = _PyObject_CallNoArgs(cls);
+ PyObject *res = PyObject_CallNoArgs(cls);
if (res == NULL) {
return NULL;
}
-
-
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_object.h" // _PyObject_GC_TRACK()
#include "pycore_tuple.h" // _PyTuple_ITEMS()
/* Python interpreter main program */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_initconfig.h" // _PyArgv
#include "pycore_interp.h" // _PyInterpreterState.sysdict
#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0()
#include "Python.h"
#include "pycore_bitutils.h" // _Py_bit_length()
-#include "pycore_dtoa.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_dtoa.h" // _Py_dg_infinity()
#include "pycore_long.h" // _PyLong_GetZero()
#include "_math.h"
#define PY_SSIZE_T_CLEAN
#include "Python.h"
-#include "pycore_fileutils.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_fileutils.h" // _Py_closerange()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#ifdef MS_WINDOWS
/* include <windows.h> early to avoid conflict with pycore_condvar.h:
#include "pycore_atomic.h" // _Py_atomic_int
#include "pycore_call.h" // _PyObject_Call()
#include "pycore_ceval.h" // _PyEval_SignalReceived()
-#include "pycore_frame.h"
+#include "pycore_frame.h" // InterpreterFrame
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_pyerrors.h" // _PyErr_SetString()
#include "pycore_pylifecycle.h" // NSIG
#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()
#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
/* 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()
#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"
/* enumerate object */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_long.h" // _PyLong_GetOne()
#include "pycore_object.h" // _PyObject_GC_TRACK()
#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. */
/* 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 *);
/* 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
/* 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()
/* 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()
*/
#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"
#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
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include <ctype.h>
#include <assert.h>
#include "Python.h"
#include <ctype.h>
#include "pycore_ast.h" // _PyAST_Validate()
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_compile.h" // _PyAST_Compile()
#include "pycore_object.h" // _Py_AddToAllObjects()
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_call.h" // _PyObject_FastCallDictTstate()
#include "pycore_ceval.h" // _PyEval_SignalAsyncExc()
-#include "pycore_code.h"
+#include "pycore_code.h" // saturating_increment()
#include "pycore_initconfig.h" // _PyStatus_OK()
#include "pycore_long.h" // _PyLong_GetZero()
#include "pycore_object.h" // _PyObject_GC_TRACK()
-#include "pycore_moduleobject.h"
+#include "pycore_moduleobject.h" // PyModuleObject
#include "pycore_pyerrors.h" // _PyErr_Fetch()
#include "pycore_pylifecycle.h" // _PyErr_Print()
#include "pycore_pymem.h" // _PyMem_IsPtrFreed()
------------------------------------------------------------------------ */
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_interp.h" // PyInterpreterState.codec_search_path
#include "pycore_pystate.h" // _PyInterpreterState_GET()
#include "pycore_ucnhash.h" // _PyUnicode_Name_CAPI
/* Error handling */
#include "Python.h"
-#include "pycore_initconfig.h"
-#include "pycore_pyerrors.h"
-#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "pycore_sysmodule.h"
-#include "pycore_traceback.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_initconfig.h" // _PyStatus_ERR()
+#include "pycore_pyerrors.h" // _PyErr_Format()
+#include "pycore_pystate.h" // _PyThreadState_GET()
+#include "pycore_sysmodule.h" // _PySys_Audit()
+#include "pycore_traceback.h" // _PyTraceBack_FromFrame()
#ifndef __STDC__
#ifndef MS_WINDOWS
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_code.h" // _PyCode_New()
+#include "pycore_hashtable.h" // _Py_hashtable_t
#include "longintrepr.h"
#include "code.h"
-#include "marshal.h"
-#include "pycore_hashtable.h"
-#include "pycore_code.h" // _PyCode_New()
+#include "marshal.h" // Py_MARSHAL_VERSION
/*[clinic input]
module marshal
*/
#include "Python.h"
+#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_RecursionLimitLowerWaterMark()
+#include "pycore_code.h" // _Py_QuickenedCount
+#include "pycore_frame.h" // InterpreterFrame
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()
#include "pycore_object.h" // _PyObject_IS_GC()
-#include "pycore_code.h" // _Py_QuickenedCount
#include "pycore_pathconfig.h" // _PyPathConfig_ComputeSysPath0()
#include "pycore_pyerrors.h" // _PyErr_Fetch()
#include "pycore_pylifecycle.h" // _PyErr_WriteUnraisableDefaultHook()
#include "pycore_pymem.h" // _PyMem_SetDefaultAllocator()
#include "pycore_pystate.h" // _PyThreadState_GET()
-#include "pycore_tuple.h" // _PyTuple_FromArray()
#include "pycore_structseq.h" // PyStructSequence_InitType()
+#include "pycore_tuple.h" // _PyTuple_FromArray()
#include "code.h"
#include "frameobject.h" // PyFrame_GetBack()
-#include "pycore_frame.h"
#include "pydtrace.h"
#include "osdefs.h" // DELIM
#include "stdlib_module_names.h" // _Py_stdlib_module_names
extra_compile_args=['-DPy_BUILD_CORE_MODULE']))
# profiler (_lsprof is for cProfile.py)
- self.add(Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']))
+ self.add(Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c'],
+ extra_compile_args=['-DPy_BUILD_CORE_MODULE']))
# static Unicode character database
self.add(Extension('unicodedata', ['unicodedata.c'],
depends=['unicodedata_db.h', 'unicodename_db.h'],