Skip to content

Commit dc35d69

Browse files
committed
Fix regression in seq_get_with_size()
Commit edf5753 introduced a regression in ``seq_get_with_size()`` where the ``temp_out`` argument was not consistently initialized on all paths. (Fortunately this did not slip into an official release yet!)
1 parent babec16 commit dc35d69

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/common.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -811,14 +811,13 @@ PyObject **seq_get_with_size(PyObject *seq, size_t size,
811811
if (size_seq != (Py_ssize_t) size) {
812812
if (size_seq == -1)
813813
PyErr_Clear();
814-
return nullptr;
814+
} else {
815+
temp = PySequence_Tuple(seq);
816+
if (temp)
817+
result = seq_get_with_size(temp, size, temp_out);
818+
else
819+
PyErr_Clear();
815820
}
816-
817-
temp = PySequence_Tuple(seq);
818-
if (temp)
819-
result = seq_get_with_size(temp, size, temp_out);
820-
else
821-
PyErr_Clear();
822821
}
823822
#else
824823
/* There isn't a nice way to get a PyObject** in Py_LIMITED_API. This

0 commit comments

Comments
 (0)