def __init__(self, exception, regexp=None):
self.exception = exception<EOL>if regexp is not None and not hasattr(regexp, "<STR_LIT>"):<EOL><INDENT>regexp = re.compile(regexp, re.DOTALL)<EOL><DEDENT>self.regexp = regexp<EOL>
Initialize an _AssertRaisesContextManager instance.

Parameters
----------
exception : class
    The expected Exception class.
regexp : str, default None
    The regex to compare against the Exception message.