mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
This commit is contained in:
parent
b1994b4a5d
commit
6819210b9e
129 changed files with 1090 additions and 1250 deletions
|
|
@ -28,7 +28,7 @@ gen_dealloc(PyGenObject *gen)
|
|||
|
||||
if (gen->gi_frame != NULL && gen->gi_frame->f_stacktop != NULL) {
|
||||
/* Generator is paused, so we need to close */
|
||||
gen->ob_type->tp_del(self);
|
||||
Py_Type(gen)->tp_del(self);
|
||||
if (self->ob_refcnt > 0)
|
||||
return; /* resurrected. :( */
|
||||
}
|
||||
|
|
@ -296,8 +296,7 @@ static PyMethodDef gen_methods[] = {
|
|||
};
|
||||
|
||||
PyTypeObject PyGen_Type = {
|
||||
PyObject_HEAD_INIT(&PyType_Type)
|
||||
0, /* ob_size */
|
||||
PyVarObject_HEAD_INIT(&PyType_Type, 0)
|
||||
"generator", /* tp_name */
|
||||
sizeof(PyGenObject), /* tp_basicsize */
|
||||
0, /* tp_itemsize */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue