Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/gcmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ gc_set_thresh(PyObject *self, PyObject *args)
&_PyRuntime.gc.generations[1].threshold,
&_PyRuntime.gc.generations[2].threshold))
return NULL;
for (i = 2; i < NUM_GENERATIONS; i++) {
for (i = 3; i < NUM_GENERATIONS; i++) {
/* generations higher than 2 get the same threshold */
_PyRuntime.gc.generations[i].threshold = _PyRuntime.gc.generations[2].threshold;
}
Expand Down Expand Up @@ -1524,7 +1524,7 @@ gc_get_objects_impl(PyObject *module, Py_ssize_t generation)
}

/* If generation is passed, we extract only that generation */
if (generation != -1) {
if (generation != -1) {
if (generation >= NUM_GENERATIONS) {
PyErr_Format(PyExc_ValueError,
"generation parameter must be less than the number of "
Expand Down