Fix import test handling of multi-line messages.
This commit is contained in:
parent
37f68bffc0
commit
0ce9e84f38
1 changed files with 2 additions and 0 deletions
|
@ -5,6 +5,7 @@ from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
import imp
|
import imp
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
@ -50,6 +51,7 @@ def main():
|
||||||
# Hack to remove the filename and line number from the message, if present.
|
# 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 = 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)
|
error = '%s:%d:%d: %s: %s' % (source, line, offset, exc_type.__name__, message)
|
||||||
|
|
||||||
if error not in messages:
|
if error not in messages:
|
||||||
|
|
Loading…
Reference in a new issue