Fix UnicodeEncodeError when string comparison with unicode has failed.

This commit is contained in:
Ahn Ki-Wook
2016-08-26 01:04:14 +09:00
parent 9c45d6cd83
commit 856ad719d3
2 changed files with 10 additions and 1 deletions

View File

@@ -354,7 +354,7 @@ class ExceptionInfo(object):
if exprinfo is None and isinstance(tup[1], AssertionError):
exprinfo = getattr(tup[1], 'msg', None)
if exprinfo is None:
exprinfo = str(tup[1])
exprinfo = py._builtin._totext(tup[1])
if exprinfo and exprinfo.startswith('assert '):
self._striptext = 'AssertionError: '
self._excinfo = tup