Skip to content

Commit

Permalink
remove weakreflist
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaraditya303 committed Jul 7, 2023
1 parent cc51492 commit 74a5fbb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions Modules/_asynciomodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ typedef enum {
PyObject *prefix##_result; \
PyObject *prefix##_source_tb; \
PyObject *prefix##_cancel_msg; \
PyObject *prefix##_weakreflist; \
PyObject *prefix##_cancelled_exc; \
fut_state prefix##_state; \
/* These bitfields need to be at the end of the struct
Expand Down Expand Up @@ -1564,9 +1563,7 @@ FutureObj_dealloc(PyObject *self)
PyTypeObject *tp = Py_TYPE(fut);
PyObject_GC_UnTrack(self);

if (fut->fut_weakreflist != NULL) {
PyObject_ClearWeakRefs(self);
}
PyObject_ClearWeakRefs(self);

(void)FutureObj_clear(fut);
tp->tp_free(fut);
Expand Down Expand Up @@ -2687,9 +2684,7 @@ TaskObj_dealloc(PyObject *self)
PyTypeObject *tp = Py_TYPE(task);
PyObject_GC_UnTrack(self);

if (task->task_weakreflist != NULL) {
PyObject_ClearWeakRefs(self);
}
PyObject_ClearWeakRefs(self);

(void)TaskObj_clear(task);
tp->tp_free(task);
Expand Down

0 comments on commit 74a5fbb

Please sign in to comment.