forked from OSchip/llvm-project
[testsuite] Drop characters that can't be decoded, restoring parity with Py2.
Tests that check the output of `memory find` may trip over unreadable characters, and in Python 3 this is an error. llvm-svn: 355612
This commit is contained in:
parent
8a4efd2153
commit
bd53e768d2
|
@ -31,6 +31,9 @@ def _encoded_write(old_write, encoding):
|
|||
# as unicode before attempting to write.
|
||||
if isinstance(s, six.binary_type):
|
||||
s = s.decode(encoding, "replace")
|
||||
# Filter unreadable characters, Python 3 is stricter than python 2 about them.
|
||||
import re
|
||||
s = re.sub(r'[^\x00-\x7f]',r' ',s)
|
||||
return old_write(s)
|
||||
return impl
|
||||
|
||||
|
|
Loading…
Reference in New Issue