MCPcopy Index your code
hub / github.com/RustPython/RustPython / decompress

Method decompress

crates/stdlib/src/bz2.rs:75–86  ·  view source on GitHub ↗
(&self, args: DecompressArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

73 impl BZ2Decompressor {
74 #[pymethod]
75 fn decompress(&self, args: DecompressArgs, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
76 let max_length = args.max_length();
77 let data = &*args.data();
78
79 let mut state = self.state.lock();
80 state
81 .decompress(data, max_length, BUFSIZ, vm)
82 .map_err(|e| match e {
83 DecompressError::Decompress(err) => vm.new_os_error(err.to_string()),
84 DecompressError::Eof(err) => err.to_pyexception(vm),
85 })
86 }
87
88 #[pygetset]
89 fn eof(&self) -> bool {

Callers 10

decompressFunction · 0.95
testDecompressMethod · 0.95
testEOFErrorMethod · 0.95
testDecompress4GMethod · 0.95

Calls 6

max_lengthMethod · 0.80
new_os_errorMethod · 0.80
to_stringMethod · 0.80
dataMethod · 0.45
lockMethod · 0.45
to_pyexceptionMethod · 0.45

Tested by 9

testDecompressMethod · 0.76
testEOFErrorMethod · 0.76
testDecompress4GMethod · 0.76