Message 299583 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
I'm hoping this is the fix:

--- Modules/_asynciomodule.c.orig	2017-07-31 12:16:16.000000000 -0700
+++ Modules/_asynciomodule.c	2017-07-31 13:08:52.000000000 -0700
@@ -953,15 +953,18 @@
 FutureObj_dealloc(PyObject *self)
 {
     FutureObj *fut = (FutureObj *)self;
+    PyObject_GC_UnTrack(self);
 
     if (Future_CheckExact(fut)) {
         /* When fut is subclass of Future, finalizer is called from
          * subtype_dealloc.
          */
+        _PyObject_GC_TRACK(self);
         if (PyObject_CallFinalizerFromDealloc(self) < 0) {
             // resurrected.
             return;
         }
+        _PyObject_GC_UNTRACK(self);
     }
 
     if (fut->fut_weakreflist != NULL) {
@@ -1828,14 +1831,18 @@
 {
     TaskObj *task = (TaskObj *)self;
 
+    PyObject_GC_UnTrack(self);
+
     if (Task_CheckExact(self)) {
         /* When fut is subclass of Task, finalizer is called from
          * subtype_dealloc.
          */
+         _PyObject_GC_TRACK(self);
         if (PyObject_CallFinalizerFromDealloc(self) < 0) {
             // resurrected.
             return;
         }
+        _PyObject_GC_UNTRACK(self);
     }
 
     if (task->task_weakreflist != NULL) {