def _formatMessage(self, msg, standardMsg):
if not self.longMessage:<EOL><INDENT>return msg or standardMsg<EOL><DEDENT>if msg is None:<EOL><INDENT>return standardMsg<EOL><DEDENT>try:<EOL><INDENT>return '<STR_LIT>' % (standardMsg, msg)<EOL><DEDENT>except UnicodeDecodeError:<EOL><INDENT>return '<STR_LIT>' % (safe_str(standardMsg), safe_str(msg))<EOL><DEDENT>
Honour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message