<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def should_retry_on(self, exception_class, logger=None):
 """ Whether this task should be retried when the given exception occurs. """

        for n in (self.retry_on or []):
            try:
                if issubclass(exception_class, import_attribute(n)):
                    return True
            except TaskImportError:
                if logger:
                    logger.error('should_retry_on could not import class',
                                 exception_name=n)
        return False