def isexception(obj):
if isinstance(obj, Exception):<EOL><INDENT>return True<EOL><DEDENT>if isclass(obj) and issubclass(obj, Exception):<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Given an object, return a boolean indicating whether it is an instance
    or subclass of :py:class:`Exception`.