def _cleanup():
 for inst in _ACTIVE[:]:
  res = inst.isalive()
  if (res is not True):
   try:
    _ACTIVE.remove(inst)
   except ValueError:
    pass

def _cleanup ( ) : for inst in _ACTIVE [ : ] : res = inst . isalive ( ) if ( res is not True ) : try : _ACTIVE . remove ( inst ) except ValueError : pass
make sure that any terminal processes still running when __del__ was called to the waited and cleaned up .