              logger.debug("Error in thread (%s): %s", self._name,
                           self.err[1].with_traceback(self.err[2]))
          finally:
              # Avoid a refcycle if the thread is running a function with
              # an argument that has a member that points to the thread.
              del self._target, self._args, self._kwargs
  
 
</s> remove                 self.complete.set()
 </s> add         except Exception:  # pylint: disable=broad-except
            self.err = sys.exc_info()
            logger.debug("Error in thread (%s): %s", self._name,
                         self.err[1].with_traceback(self.err[2])) </s> remove         if self.complete.is_set():
            logger.debug("Getting result from thread")
            retval = self._queue.get()
 </s> add         if not self.complete.is_set():
            logger.warning("Aborting attempt to retrieve result from a LongRunningTask that is "
                           "still running")
            return None
        if self.err:
            logger.debug("Error caught in thread")
            self._config.set_cursor_default(widget=self.widget)
            raise self.err[1].with_traceback(self.err[2])

        logger.debug("Getting result from thread")
        retval = self._queue.get()
            self.complete.set()
              logger.debug("Error in thread (%s): %s", self._name,
                           self.err[1].with_traceback(self.err[2]))
          finally:
            self.complete.set()
              # Avoid a refcycle if the thread is running a function with
              # an argument that has a member that points to the thread.
              del self._target, self._args, self._kwargs
  
keep keep add keep keep keep keep
 GUI responsiveness and feature updates

- Add error handling to LongRunningTask
- Analysis: Fix timestats bug for missing session data
- Training: Update training graph inside LongRunningTask
- Training: Smoothing Amount Slider geometry fix
- Training: Auto update Analysis tab on training start and save interval
- Scripts: Keep control of the UI when terminating by terminating using LongRunningTask 
lib/gui/utils.py