Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _check_action(self, action):
"""Check if a passed action is a subclass of BasicAction"""
if not isinstance(action, BasicAction):
if isinstance(action, type):
error_msg = "You passed a class as action for '{}' but an instance of an action was expected!".format(self.identifier)
else:
error_msg = "You did not pass an action object - inheriting from BasicAction - to '{}'".format(self.identifier)
self.logger.error(error_msg)
raise InvalidActionError(error_msg)