We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 895b685 commit fef6412Copy full SHA for fef6412
Modules/itertoolsmodule.c
@@ -682,11 +682,8 @@ _grouper_next(PyObject *op)
682
mutating gbo->currkey while we are comparing them.
683
Take local snapshots and hold strong references so INCREF/DECREF
684
apply to the same objects even under re-entrancy. */
685
- PyObject *tgtkey = igo->tgtkey;
686
- PyObject *currkey = gbo->currkey;
687
-
688
- Py_INCREF(tgtkey);
689
- Py_INCREF(currkey);
+ PyObject *tgtkey = Py_NewRef(igo->tgtkey);
+ PyObject *currkey = Py_NewRef(gbo->currkey);
690
rcmp = PyObject_RichCompareBool(tgtkey, currkey, Py_EQ);
691
Py_DECREF(tgtkey);
692
Py_DECREF(currkey);
0 commit comments