gh-106320: Remove private _PyModule API (#107070)
Move private _PyModule API to the internal C API (pycore_moduleobject.h): * _PyModule_Clear() * _PyModule_ClearDict() * _PyModuleSpec_IsInitializing() * _PyModule_IsExtension() No longer export these functions.
This commit is contained in:
@@ -8,6 +8,12 @@ extern "C" {
|
|||||||
# error "this header requires Py_BUILD_CORE define"
|
# error "this header requires Py_BUILD_CORE define"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern void _PyModule_Clear(PyObject *);
|
||||||
|
extern void _PyModule_ClearDict(PyObject *);
|
||||||
|
extern int _PyModuleSpec_IsInitializing(PyObject *);
|
||||||
|
|
||||||
|
extern int _PyModule_IsExtension(PyObject *obj);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_HEAD
|
PyObject_HEAD
|
||||||
PyObject *md_dict;
|
PyObject *md_dict;
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
|
|||||||
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
|
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
|
||||||
Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
|
Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
|
||||||
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
|
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
|
||||||
#ifndef Py_LIMITED_API
|
|
||||||
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
|
|
||||||
PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
|
|
||||||
PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *);
|
|
||||||
#endif
|
|
||||||
PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*);
|
PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*);
|
||||||
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
|
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
|
||||||
|
|
||||||
@@ -103,12 +98,6 @@ struct PyModuleDef {
|
|||||||
freefunc m_free;
|
freefunc m_free;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Internal C API
|
|
||||||
#ifdef Py_BUILD_CORE
|
|
||||||
extern int _PyModule_IsExtension(PyObject *obj);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user