summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_ceval.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-03-21 01:24:00 (GMT)
committerGitHub <noreply@github.com>2022-03-21 01:24:00 (GMT)
commit9087243e2c167e38570e819b228efc3492c38c9c (patch)
treed59acfac968561a9518027489f8478dfccdf0607 /Include/internal/pycore_ceval.h
parent332b04bac35cd7305c60da2d5733940dc089949a (diff)
downloadcpython-9087243e2c167e38570e819b228efc3492c38c9c.zip
cpython-9087243e2c167e38570e819b228efc3492c38c9c.tar.gz
cpython-9087243e2c167e38570e819b228efc3492c38c9c.tar.bz2
bpo-46850: Remove _PyEval_GetCoroutineOriginTrackingDepth() (GH-32018)
Remove the private undocumented function _PyEval_GetCoroutineOriginTrackingDepth() from the C API. Call the public sys.get_coroutine_origin_tracking_depth() function instead. Change the internal function _PyEval_SetCoroutineOriginTrackingDepth(): * Remove the 'tstate' parameter; * Add return value and raises an exception if depth is negative; * No longer export the function: call the public sys.set_coroutine_origin_tracking_depth() function instead. Uniformize also function declarations in pycore_ceval.h.
Diffstat (limited to 'Include/internal/pycore_ceval.h')
-rw-r--r--Include/internal/pycore_ceval.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/Include/internal/pycore_ceval.h b/Include/internal/pycore_ceval.h
index 3efd13d..59a3453 100644
--- a/Include/internal/pycore_ceval.h
+++ b/Include/internal/pycore_ceval.h
@@ -33,9 +33,6 @@ PyAPI_FUNC(void) _PyEval_SignalAsyncExc(PyInterpreterState *interp);
#ifdef HAVE_FORK
extern PyStatus _PyEval_ReInitThreads(PyThreadState *tstate);
#endif
-PyAPI_FUNC(void) _PyEval_SetCoroutineOriginTrackingDepth(
- PyThreadState *tstate,
- int new_depth);
// Used by sys.get_asyncgen_hooks()
extern PyObject* _PyEval_GetAsyncGenFirstiter(void);
@@ -45,11 +42,16 @@ extern PyObject* _PyEval_GetAsyncGenFinalizer(void);
extern int _PyEval_SetAsyncGenFirstiter(PyObject *);
extern int _PyEval_SetAsyncGenFinalizer(PyObject *);
-void _PyEval_Fini(void);
+// Used by sys.get_coroutine_origin_tracking_depth()
+// and sys.set_coroutine_origin_tracking_depth()
+extern int _PyEval_GetCoroutineOriginTrackingDepth(void);
+extern int _PyEval_SetCoroutineOriginTrackingDepth(int depth);
+
+extern void _PyEval_Fini(void);
extern PyObject* _PyEval_GetBuiltins(PyThreadState *tstate);
-extern PyObject *_PyEval_BuiltinsFromGlobals(
+extern PyObject* _PyEval_BuiltinsFromGlobals(
PyThreadState *tstate,
PyObject *globals);
@@ -63,7 +65,7 @@ _PyEval_EvalFrame(PyThreadState *tstate, struct _PyInterpreterFrame *frame, int
return tstate->interp->eval_frame(tstate, frame, throwflag);
}
-extern PyObject *
+extern PyObject*
_PyEval_Vector(PyThreadState *tstate,
PyFunctionObject *func, PyObject *locals,
PyObject* const* args, size_t argcount,
@@ -124,9 +126,9 @@ static inline void _Py_LeaveRecursiveCall_inline(void) {
#define Py_LeaveRecursiveCall() _Py_LeaveRecursiveCall_inline()
-struct _PyInterpreterFrame *_PyEval_GetFrame(void);
+extern struct _PyInterpreterFrame* _PyEval_GetFrame(void);
-PyObject *_Py_MakeCoro(PyFunctionObject *func);
+extern PyObject* _Py_MakeCoro(PyFunctionObject *func);
#ifdef __cplusplus
}