File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -659,14 +659,24 @@ ga_iternext(gaiterobject *gi) {
659
659
static void
660
660
ga_iter_dealloc (gaiterobject * gi ) {
661
661
PyObject_GC_UnTrack (gi );
662
+ Py_XDECREF (gi -> obj );
662
663
PyObject_GC_Del (gi );
663
664
}
664
665
666
+ static int
667
+ ga_iter_traverse (gaiterobject * gi , visitproc visit , void * arg )
668
+ {
669
+ Py_VISIT (gi -> obj );
670
+ return 0 ;
671
+ }
672
+
665
673
static PyTypeObject Py_GenericAliasIterType = {
666
674
PyVarObject_HEAD_INIT (& PyType_Type , 0 )
667
- .tp_name = "generic_alias_iter " ,
675
+ .tp_name = "generic_alias_iterator " ,
668
676
.tp_basicsize = sizeof (gaiterobject ),
677
+ .tp_iter = PyObject_SelfIter ,
669
678
.tp_iternext = (iternextfunc )ga_iternext ,
679
+ .tp_traverse = (traverseproc )ga_iter_traverse ,
670
680
.tp_dealloc = (destructor )ga_iter_dealloc ,
671
681
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC ,
672
682
};
You can’t perform that action at this time.
0 commit comments