[Python-checkins] cpython (merge 3.2 -> default): merge 3.2

benjamin.peterson python-checkins at python.org
Thu Sep 1 22:42:38 CEST 2011


http://hg.python.org/cpython/rev/0212858cae57
changeset: 72166:0212858cae57
parent: 72164:d72d5c942232
parent: 72165:51e27f42beda
user: Benjamin Peterson <benjamin at python.org>
date: Thu Sep 01 16:33:56 2011 -0400
summary:
 merge 3.2
files:
 Include/descrobject.h | 1 +
 Objects/descrobject.c | 9 +++------
 Objects/object.c | 3 +++
 3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/Include/descrobject.h b/Include/descrobject.h
--- a/Include/descrobject.h
+++ b/Include/descrobject.h
@@ -77,6 +77,7 @@
 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
 PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
+PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
 
 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
diff --git a/Objects/descrobject.c b/Objects/descrobject.c
--- a/Objects/descrobject.c
+++ b/Objects/descrobject.c
@@ -846,16 +846,13 @@
 /* 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 @@
 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 @@
 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;
diff --git a/Objects/object.c b/Objects/object.c
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1558,6 +1558,9 @@
 if (PyType_Ready(&PyWrapperDescr_Type) < 0)
 Py_FatalError("Can't initialize wrapper type");
 
+ if (PyType_Ready(&_PyMethodWrapper_Type) < 0)
+ Py_FatalError("Can't initialize method wrapper type");
+
 if (PyType_Ready(&PyEllipsis_Type) < 0)
 Py_FatalError("Can't initialize ellipsis type");
 
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /