I want to create a function that can check if the passed arg is an Exception or one of its subclasses. As an example, I would like the the second is_exception function call to return True as well.
def is_exception(obj):
return type(obj) == Exception
print is_exception(Exception('asdf')) => True
print is_exception(EOFError('asdf')) => False
thanks!