Fix import test handling of multi-line messages.

This commit is contained in:
Matt Clay 2017-09-14 09:01:11 -07:00
parent 37f68bffc0
commit 0ce9e84f38

View file

@ -5,6 +5,7 @@ from __future__ import absolute_import, print_function
import imp
import os
import re
import sys
import traceback
@ -50,6 +51,7 @@ def main():
# Hack to remove the filename and line number from the message, if present.
message = message.replace(' (%s, line %d)' % (os.path.basename(path), line), '')
message = re.sub(r'\n *', ': ', message)
error = '%s:%d:%d: %s: %s' % (source, line, offset, exc_type.__name__, message)
if error not in messages: