From 5719b65bf16590fc7272fe073a8f1e5b723ad826 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 29 Aug 2023 04:29:01 +0200 Subject: [PATCH] gh-106320: Remove private _PyObject_GetState() Move the private _PyObject_GetState() function to the internal C API (pycore_object.h). No longer export the function. --- Include/internal/pycore_object.h | 4 ++++ Include/object.h | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Include/internal/pycore_object.h b/Include/internal/pycore_object.h index c6007718bae5a4..32ff2794e36231 100644 --- a/Include/internal/pycore_object.h +++ b/Include/internal/pycore_object.h @@ -442,6 +442,10 @@ extern int _PyObject_IsAbstract(PyObject *); extern int _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method); extern PyObject* _PyObject_NextNotImplemented(PyObject *); +// Pickle support. +// Export for '_datetime' shared extension +PyAPI_FUNC(PyObject*) _PyObject_GetState(PyObject *); + /* C function call trampolines to mitigate bad function pointer casts. * * Typical native ABIs ignore additional arguments or fill in missing diff --git a/Include/object.h b/Include/object.h index be9a0cedb7205d..d82eb6138743b9 100644 --- a/Include/object.h +++ b/Include/object.h @@ -437,12 +437,6 @@ PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *); */ PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *); -/* Pickle support. */ -#ifndef Py_LIMITED_API -PyAPI_FUNC(PyObject *) _PyObject_GetState(PyObject *); -#endif - - /* Helpers for printing recursive container types */ PyAPI_FUNC(int) Py_ReprEnter(PyObject *); PyAPI_FUNC(void) Py_ReprLeave(PyObject *);