<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exception(self):
 """ Try retrieving the last subprocess exception. If set, the exception is returned. Otherwise None is returned. """

        if self._exception is not None:
            return self._exception
        try:
            exc, tblines = self.exc_queue.get_nowait()
        except Empty:
            self._exception, self.tb_lines = None, None
        else:
            # Raise any exception that the subprocess encountered and sent.
            self._exception, self.tb_lines = exc, tblines
        return self._exception