X Tutup
Skip to content
Draft
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
1 change: 1 addition & 0 deletions Objects/listobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3260,6 +3260,7 @@ _PyList_AsTupleAndClear(PyListObject *self)
Py_ssize_t size = Py_SIZE(self);
self->ob_item = NULL;
Py_SET_SIZE(self, 0);
self->allocated = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list_clear_impl has extra code if Py_GIL_DISABLED - should we include it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment, there is a discussion on the issue right now but I'll keep that in mind when time comes.

ret = _PyTuple_FromArraySteal(items, size);
free_list_items(items, false);
Py_END_CRITICAL_SECTION();
Expand Down
Loading
X Tutup