Skip to content

Commit f1dac17

Browse files
vstinnermementum
authored andcommitted
pythongh-106320: Move _PyMethodWrapper_Type to internal C API (python#107064)
1 parent 955e351 commit f1dac17

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

Include/cpython/descrobject.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ typedef struct {
5757
void *d_wrapped; /* This can be any function pointer */
5858
} PyWrapperDescrObject;
5959

60-
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
61-
6260
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
6361
struct wrapperbase *, void *);
6462
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);

Include/internal/pycore_descrobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ typedef struct {
2020

2121
typedef propertyobject _PyPropertyObject;
2222

23+
extern PyTypeObject _PyMethodWrapper_Type;
24+
2325
#ifdef __cplusplus
2426
}
2527
#endif

Objects/descrobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "pycore_abstract.h" // _PyObject_RealIsSubclass()
55
#include "pycore_call.h" // _PyStack_AsDict()
66
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
7+
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
78
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
89
#include "pycore_pystate.h" // _PyThreadState_GET()
910
#include "pycore_tuple.h" // _PyTuple_ITEMS()
1011
#include "structmember.h" // PyMemberDef
11-
#include "pycore_descrobject.h"
1212

1313
/*[clinic input]
1414
class mappingproxy "mappingproxyobject *" "&PyDictProxy_Type"

Objects/object.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "pycore_call.h" // _PyObject_CallNoArgs()
66
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
77
#include "pycore_context.h" // _PyContextTokenMissing_Type
8+
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
89
#include "pycore_dict.h" // _PyObject_MakeDictFromInstanceAttributes()
910
#include "pycore_floatobject.h" // _PyFloat_DebugMallocStats()
1011
#include "pycore_initconfig.h" // _PyStatus_EXCEPTION()

Python/specialize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#include "Python.h"
22
#include "pycore_code.h"
3+
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
34
#include "pycore_dict.h"
45
#include "pycore_function.h" // _PyFunction_GetVersionForCurrentState()
56
#include "pycore_global_strings.h" // _Py_ID()
67
#include "pycore_long.h"
78
#include "pycore_moduleobject.h"
89
#include "pycore_object.h"
910
#include "pycore_opcode.h" // _PyOpcode_Caches
10-
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX
11-
#include "pycore_descrobject.h"
1211
#include "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
12+
#include "structmember.h" // struct PyMemberDef, T_OFFSET_EX
1313

1414
#include <stdlib.h> // rand()
1515

0 commit comments

Comments
 (0)