summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/scripts')
-rwxr-xr-xlib/sanitizer_common/scripts/sancov.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sanitizer_common/scripts/sancov.py b/lib/sanitizer_common/scripts/sancov.py
index 24d6b504d..cd1fdb31f 100755
--- a/lib/sanitizer_common/scripts/sancov.py
+++ b/lib/sanitizer_common/scripts/sancov.py
@@ -99,9 +99,10 @@ def MergeAndPrint(files):
bits = 32
if max(s) > 0xFFFFFFFF:
bits = 64
- array.array('I', MagicForBits(bits)).tofile(sys.stdout)
+ stdout_buf = getattr(sys.stdout, 'buffer', sys.stdout)
+ array.array('I', MagicForBits(bits)).tofile(stdout_buf)
a = struct.pack(TypeCodeForStruct(bits) * len(s), *s)
- sys.stdout.write(a)
+ stdout_buf.write(a)
def UnpackOneFile(path):