Skip to content

Commit a662ecf

Browse files
committed
Add missing ifdef guard.
1 parent 1433cd3 commit a662ecf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/specialize.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2652,6 +2652,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
26522652
PyObject *iter_o = PyStackRef_AsPyObjectBorrow(iter);
26532653
PyTypeObject *tp = Py_TYPE(iter_o);
26542654
if (tp == &PyListIter_Type) {
2655+
#ifdef Py_GIL_DISABLED
26552656
_PyListIterObject *it = (_PyListIterObject *)iter_o;
26562657
if (!_Py_IsOwnedByCurrentThread((PyObject *)it->it_seq) &&
26572658
!_PyObject_GC_IS_SHARED(it->it_seq)) {
@@ -2661,6 +2662,7 @@ _Py_Specialize_ForIter(_PyStackRef iter, _Py_CODEUNIT *instr, int oparg)
26612662
unspecialize(instr);
26622663
return;
26632664
}
2665+
#endif
26642666
specialize(instr, FOR_ITER_LIST);
26652667
return;
26662668
}

0 commit comments

Comments
 (0)