@@ -92,7 +92,7 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
9292 "descriptor '%V' for type '%s' "
9393 "needs either an object or a type" ,
9494 descr_name ((PyDescrObject * )descr ), "?" ,
95- descr -> d_type -> tp_name );
95+ PyDescr_TYPE ( descr ) -> tp_name );
9696 return NULL ;
9797 }
9898 }
@@ -101,16 +101,16 @@ classmethod_get(PyMethodDescrObject *descr, PyObject *obj, PyObject *type)
101101 "descriptor '%V' for type '%s' "
102102 "needs a type, not a '%s' as arg 2" ,
103103 descr_name ((PyDescrObject * )descr ), "?" ,
104- descr -> d_type -> tp_name ,
104+ PyDescr_TYPE ( descr ) -> tp_name ,
105105 type -> ob_type -> tp_name );
106106 return NULL ;
107107 }
108- if (!PyType_IsSubtype ((PyTypeObject * )type , descr -> d_type )) {
108+ if (!PyType_IsSubtype ((PyTypeObject * )type , PyDescr_TYPE ( descr ) )) {
109109 PyErr_Format (PyExc_TypeError ,
110110 "descriptor '%V' for type '%s' "
111111 "doesn't apply to type '%s'" ,
112112 descr_name ((PyDescrObject * )descr ), "?" ,
113- descr -> d_type -> tp_name ,
113+ PyDescr_TYPE ( descr ) -> tp_name ,
114114 ((PyTypeObject * )type )-> tp_name );
115115 return NULL ;
116116 }
@@ -149,7 +149,7 @@ getset_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *type)
149149 PyErr_Format (PyExc_AttributeError ,
150150 "attribute '%V' of '%.100s' objects is not readable" ,
151151 descr_name ((PyDescrObject * )descr ), "?" ,
152- descr -> d_type -> tp_name );
152+ PyDescr_TYPE ( descr ) -> tp_name );
153153 return NULL ;
154154}
155155
@@ -204,7 +204,7 @@ getset_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value)
204204 PyErr_Format (PyExc_AttributeError ,
205205 "attribute '%V' of '%.100s' objects is not writable" ,
206206 descr_name ((PyDescrObject * )descr ), "?" ,
207- descr -> d_type -> tp_name );
207+ PyDescr_TYPE ( descr ) -> tp_name );
208208 return -1 ;
209209}
210210
@@ -222,17 +222,17 @@ methoddescr_call(PyMethodDescrObject *descr, PyObject *args, PyObject *kwds)
222222 "descriptor '%V' of '%.100s' "
223223 "object needs an argument" ,
224224 descr_name ((PyDescrObject * )descr ), "?" ,
225- descr -> d_type -> tp_name );
225+ PyDescr_TYPE ( descr ) -> tp_name );
226226 return NULL ;
227227 }
228228 self = PyTuple_GET_ITEM (args , 0 );
229- if (!PyObject_IsInstance (self , (PyObject * )(descr -> d_type ))) {
229+ if (!PyObject_IsInstance (self , (PyObject * )PyDescr_TYPE (descr ))) {
230230 PyErr_Format (PyExc_TypeError ,
231231 "descriptor '%V' "
232232 "requires a '%.100s' object "
233233 "but received a '%.100s'" ,
234234 descr_name ((PyDescrObject * )descr ), "?" ,
235- descr -> d_type -> tp_name ,
235+ PyDescr_TYPE ( descr ) -> tp_name ,
236236 self -> ob_type -> tp_name );
237237 return NULL ;
238238 }
@@ -257,7 +257,7 @@ classmethoddescr_call(PyMethodDescrObject *descr, PyObject *args,
257257{
258258 PyObject * func , * result ;
259259
260- func = PyCFunction_New (descr -> d_method , (PyObject * )descr -> d_type );
260+ func = PyCFunction_New (descr -> d_method , (PyObject * )PyDescr_TYPE ( descr ) );
261261 if (func == NULL )
262262 return NULL ;
263263
@@ -280,17 +280,17 @@ wrapperdescr_call(PyWrapperDescrObject *descr, PyObject *args, PyObject *kwds)
280280 "descriptor '%V' of '%.100s' "
281281 "object needs an argument" ,
282282 descr_name ((PyDescrObject * )descr ), "?" ,
283- descr -> d_type -> tp_name );
283+ PyDescr_TYPE ( descr ) -> tp_name );
284284 return NULL ;
285285 }
286286 self = PyTuple_GET_ITEM (args , 0 );
287- if (!PyObject_IsInstance (self , (PyObject * )(descr -> d_type ))) {
287+ if (!PyObject_IsInstance (self , (PyObject * )PyDescr_TYPE (descr ))) {
288288 PyErr_Format (PyExc_TypeError ,
289289 "descriptor '%V' "
290290 "requires a '%.100s' object "
291291 "but received a '%.100s'" ,
292292 descr_name ((PyDescrObject * )descr ), "?" ,
293- descr -> d_type -> tp_name ,
293+ PyDescr_TYPE ( descr ) -> tp_name ,
294294 self -> ob_type -> tp_name );
295295 return NULL ;
296296 }
@@ -949,7 +949,7 @@ static PyMemberDef wrapper_members[] = {
949949static PyObject *
950950wrapper_objclass (wrapperobject * wp )
951951{
952- PyObject * c = (PyObject * )wp -> descr -> d_type ;
952+ PyObject * c = (PyObject * )PyDescr_TYPE ( wp -> descr ) ;
953953
954954 Py_INCREF (c );
955955 return c ;
@@ -1059,7 +1059,7 @@ PyWrapper_New(PyObject *d, PyObject *self)
10591059
10601060 assert (PyObject_TypeCheck (d , & PyWrapperDescr_Type ));
10611061 descr = (PyWrapperDescrObject * )d ;
1062- assert (PyObject_IsInstance (self , (PyObject * )(descr -> d_type )));
1062+ assert (PyObject_IsInstance (self , (PyObject * )PyDescr_TYPE (descr )));
10631063
10641064 wp = PyObject_GC_New (wrapperobject , & wrappertype );
10651065 if (wp != NULL ) {
0 commit comments