MCPcopy Index your code
hub / github.com/python/cpython / ext_decompress

Function ext_decompress

Lib/test/test_bz2.py:29–36  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

27has_cmdline_bunzip2 = None
28
29def ext_decompress(data):
30 global has_cmdline_bunzip2
31 if has_cmdline_bunzip2 is None:
32 has_cmdline_bunzip2 = bool(shutil.which('bunzip2'))
33 if has_cmdline_bunzip2:
34 return subprocess.check_output(['bunzip2'], input=data)
35 else:
36 return bz2.decompress(data)
37
38class BaseTest(unittest.TestCase):
39 "Base for other testcases."

Callers 13

test_compressorMethod · 0.90
testWriteMethod · 0.85
testWriteChunks10Method · 0.85
testWriteLinesMethod · 0.85
testAppendMethod · 0.85
testWriteBytesIOMethod · 0.85
testCompressMethod · 0.85
testCompressChunks10Method · 0.85
testCompressMethod · 0.85
test_binary_modesMethod · 0.85
test_text_modesMethod · 0.85

Calls 2

decompressMethod · 0.80
check_outputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…