Skip to content

Commit b6de285

Browse files
authored
gh-106320: Remove private _PyObject_GetState() (#108606)
Move the private _PyObject_GetState() function to the internal C API (pycore_object.h).
1 parent fadc2dc commit b6de285

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Include/internal/pycore_object.h

+4
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,10 @@ extern int _PyObject_IsAbstract(PyObject *);
442442
extern int _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
443443
extern PyObject* _PyObject_NextNotImplemented(PyObject *);
444444

445+
// Pickle support.
446+
// Export for '_datetime' shared extension
447+
PyAPI_FUNC(PyObject*) _PyObject_GetState(PyObject *);
448+
445449
/* C function call trampolines to mitigate bad function pointer casts.
446450
*
447451
* Typical native ABIs ignore additional arguments or fill in missing

Include/object.h

-6
Original file line numberDiff line numberDiff line change
@@ -437,12 +437,6 @@ PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);
437437
*/
438438
PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *);
439439

440-
/* Pickle support. */
441-
#ifndef Py_LIMITED_API
442-
PyAPI_FUNC(PyObject *) _PyObject_GetState(PyObject *);
443-
#endif
444-
445-
446440
/* Helpers for printing recursive container types */
447441
PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
448442
PyAPI_FUNC(void) Py_ReprLeave(PyObject *);

0 commit comments

Comments
 (0)