[llvm] r309473 - lit::shtest-format.py: Make write-bad-encoding.py py3-aware.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 28 19:52:57 PDT 2017
Author: chapuni
Date: Fri Jul 28 19:52:56 2017
New Revision: 309473
URL: http://llvm.org/viewvc/llvm-project?rev=309473&view=rev
Log:
lit::shtest-format.py: Make write-bad-encoding.py py3-aware.
Traceback (most recent call last):
File "llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py", line 5, in <module>
sys.stdout.write(b"a line with bad encoding: \xc2.")
sys.stdout.write doesn't accept bytes but sys.stdout.buffer.write accepts.
Modified:
llvm/trunk/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py
Modified: llvm/trunk/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py?rev=309473&r1=309472&r2=309473&view=diff
==============================================================================
--- llvm/trunk/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py (original)
+++ llvm/trunk/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py Fri Jul 28 19:52:56 2017
@@ -2,5 +2,5 @@
import sys
-sys.stdout.write(b"a line with bad encoding: \xc2.")
+getattr(sys.stdout, "buffer", sys.stdout).write(b"a line with bad encoding: \xc2.")
sys.stdout.flush()
More information about the llvm-commits
mailing list