(_cls: &Py<PyType>, args: Self::Args, vm: &VirtualMachine)
| 572 | type Args = DecompressobjArgs; |
| 573 | |
| 574 | fn py_new(_cls: &Py<PyType>, args: Self::Args, vm: &VirtualMachine) -> PyResult<Self> { |
| 575 | let mut decompress = InitOptions::new(args.wbits.value, vm)?.decompress(); |
| 576 | let zdict = args.zdict.into_option(); |
| 577 | if let Some(dict) = &zdict |
| 578 | && args.wbits.value < 0 |
| 579 | { |
| 580 | dict.with_ref(|d| decompress.set_dictionary(d)) |
| 581 | .map_err(|_| new_zlib_error("failed to set dictionary", vm))?; |
| 582 | } |
| 583 | let inner = DecompressState::new(DecompressWithDict { decompress, zdict }, vm); |
| 584 | Ok(Self { |
| 585 | inner: PyMutex::new(inner), |
| 586 | }) |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | #[pyclass(with(Constructor))] |
nothing calls this directly
no test coverage detected