File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed
Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -545,20 +545,16 @@ groupby_next(PyObject *op)
545545 break ;
546546 else {
547547 int rcmp ;
548- PyObject * tgtkey = gbo -> tgtkey ;
549- PyObject * currkey = gbo -> currkey ;
550-
548+
551549 /* Hold strong references during comparison to prevent re-entrant __eq__
552550 from advancing the iterator and invalidating borrowed references. */
553- PyObject * tgtkey = gbo -> tgtkey ;
554- PyObject * currkey = gbo -> currkey ;
555- Py_INCREF (tgtkey );
556- Py_INCREF (currkey );
551+ Py_INCREF (gbo -> tgtkey );
552+ Py_INCREF (gbo -> currkey );
557553
558554 rcmp = PyObject_RichCompareBool (tgtkey , currkey , Py_EQ );
559555
560- Py_DECREF (tgtkey );
561- Py_DECREF (currkey );
556+ Py_DECREF (gbo -> tgtkey );
557+ Py_DECREF (gbo -> currkey );
562558
563559 if (rcmp == -1 )
564560 return NULL ;
You can’t perform that action at this time.
0 commit comments