llvm-for-llvmta/test/tools/llvm-objcopy/Inputs/ungzip.py

14 lines
313 B
Python
Raw Permalink Normal View History

2022-04-25 10:02:23 +02:00
import gzip
import sys
with gzip.open(sys.argv[1], 'rb') as f:
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()