Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e35dc51

Browse files
committed
merge 3.2
2 parents 5edbaf2 + eff61f6 commit e35dc51

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

Include/descrobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
7777
PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
7878
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
7979
PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
80+
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
8081

8182
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
8283
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);

Objects/descrobject.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -846,16 +846,13 @@ PyDictProxy_New(PyObject *dict)
846846
/* This has no reason to be in this file except that adding new files is a
847847
bit of a pain */
848848

849-
/* forward */
850-
static PyTypeObject wrappertype;
851-
852849
typedef struct {
853850
PyObject_HEAD
854851
PyWrapperDescrObject *descr;
855852
PyObject *self;
856853
} wrapperobject;
857854

858-
#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype)
855+
#define Wrapper_Check(v) (Py_TYPE(v) == &_PyMethodWrapper_Type)
859856

860857
static void
861858
wrapper_dealloc(wrapperobject *wp)
@@ -1021,7 +1018,7 @@ wrapper_traverse(PyObject *self, visitproc visit, void *arg)
10211018
return 0;
10221019
}
10231020

1024-
static PyTypeObject wrappertype = {
1021+
PyTypeObject _PyMethodWrapper_Type = {
10251022
PyVarObject_HEAD_INIT(&PyType_Type, 0)
10261023
"method-wrapper", /* tp_name */
10271024
sizeof(wrapperobject), /* tp_basicsize */
@@ -1070,7 +1067,7 @@ PyWrapper_New(PyObject *d, PyObject *self)
10701067
assert(_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self),
10711068
(PyObject *)PyDescr_TYPE(descr)));
10721069

1073-
wp = PyObject_GC_New(wrapperobject, &wrappertype);
1070+
wp = PyObject_GC_New(wrapperobject, &_PyMethodWrapper_Type);
10741071
if (wp != NULL) {
10751072
Py_INCREF(descr);
10761073
wp->descr = descr;

Objects/object.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,6 +1558,9 @@ _Py_ReadyTypes(void)
15581558
if (PyType_Ready(&PyWrapperDescr_Type) < 0)
15591559
Py_FatalError("Can't initialize wrapper type");
15601560

1561+
if (PyType_Ready(&_PyMethodWrapper_Type) < 0)
1562+
Py_FatalError("Can't initialize method wrapper type");
1563+
15611564
if (PyType_Ready(&PyEllipsis_Type) < 0)
15621565
Py_FatalError("Can't initialize ellipsis type");
15631566

0 commit comments

Comments
 (0)