This actually does not handle the thread exit but creates and returns a function which handles it.
This is confusing when reading the code.
If your intention is to keep a reference to the future consider using partial().
e.g.

t.link(partial(self._handle_thread_exited(future))

def _handle_thread_exited(self, future, gt):
     with ....