diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-09-01 20:32:31 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-09-01 20:32:31 (GMT) |
commit | eff61f6927c94c82b5fc8f0a266340f1e91a363c (patch) | |
tree | ced3487c4462481dc588ee9aac7592e04b6171ae /Objects/descrobject.c | |
parent | a762285831d1591d5c621394f8f6be45688ba33d (diff) | |
download | cpython-eff61f6927c94c82b5fc8f0a266340f1e91a363c.zip cpython-eff61f6927c94c82b5fc8f0a266340f1e91a363c.tar.gz cpython-eff61f6927c94c82b5fc8f0a266340f1e91a363c.tar.bz2 |
make sure to initialize the method wrapper type
Diffstat (limited to 'Objects/descrobject.c')
-rw-r--r-- | Objects/descrobject.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 93daefd..a786bae 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -846,16 +846,13 @@ PyDictProxy_New(PyObject *dict) /* This has no reason to be in this file except that adding new files is a bit of a pain */ -/* forward */ -static PyTypeObject wrappertype; - typedef struct { PyObject_HEAD PyWrapperDescrObject *descr; PyObject *self; } wrapperobject; -#define Wrapper_Check(v) (Py_TYPE(v) == &wrappertype) +#define Wrapper_Check(v) (Py_TYPE(v) == &_PyMethodWrapper_Type) static void wrapper_dealloc(wrapperobject *wp) @@ -1021,7 +1018,7 @@ wrapper_traverse(PyObject *self, visitproc visit, void *arg) return 0; } -static PyTypeObject wrappertype = { +PyTypeObject _PyMethodWrapper_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "method-wrapper", /* tp_name */ sizeof(wrapperobject), /* tp_basicsize */ @@ -1070,7 +1067,7 @@ PyWrapper_New(PyObject *d, PyObject *self) assert(_PyObject_RealIsSubclass((PyObject *)Py_TYPE(self), (PyObject *)PyDescr_TYPE(descr))); - wp = PyObject_GC_New(wrapperobject, &wrappertype); + wp = PyObject_GC_New(wrapperobject, &_PyMethodWrapper_Type); if (wp != NULL) { Py_INCREF(descr); wp->descr = descr; |