[PATCH] D49515: [llvm-objcopy, tests] Fix several llvm-objcopy tests

Stella Stamenova via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 09:24:48 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL337567: [llvm-objcopy, tests] Fix several llvm-objcopy tests (authored by stella.stamenova, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D49515?vs=156162&id=156515#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D49515

Files:
  llvm/trunk/test/tools/llvm-objcopy/Inputs/ungzip.py


Index: llvm/trunk/test/tools/llvm-objcopy/Inputs/ungzip.py
===================================================================
--- llvm/trunk/test/tools/llvm-objcopy/Inputs/ungzip.py
+++ llvm/trunk/test/tools/llvm-objcopy/Inputs/ungzip.py
@@ -2,4 +2,12 @@
 import sys
 
 with gzip.open(sys.argv[1], 'rb') as f:
-  sys.stdout.write(f.read())
+  writer = getattr(sys.stdout, 'buffer', None)
+  if writer is None:
+    writer = sys.stdout
+    if sys.platform == "win32":
+      import os, msvcrt
+      msvcrt.setmode(sys.stdout.fileno(),os.O_BINARY)
+
+  writer.write(f.read())
+  sys.stdout.flush()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49515.156515.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180720/ff2dd3e3/attachment.bin>


More information about the llvm-commits mailing list