(zelf: PyObjectRef, args: FuncArgs, vm: &VirtualMachine)
| 1586 | |
| 1587 | #[pyslot] |
| 1588 | fn slot_init(zelf: PyObjectRef, args: FuncArgs, vm: &VirtualMachine) -> PyResult<()> { |
| 1589 | let zelf: PyRef<Self> = zelf.try_into_value(vm)?; |
| 1590 | let (raw, BufferSize { buffer_size }): (PyObjectRef, _) = |
| 1591 | args.bind(vm).map_err(|e| { |
| 1592 | let str_repr = e |
| 1593 | .__str__(vm) |
| 1594 | .as_ref() |
| 1595 | .map_or("<error getting exception str>".as_ref(), |s| s.as_wtf8()) |
| 1596 | .to_owned(); |
| 1597 | let msg = format!("{}() {}", Self::CLASS_NAME, str_repr); |
| 1598 | vm.new_exception_msg(e.class().to_owned(), msg.into()) |
| 1599 | })?; |
| 1600 | zelf.init(raw, BufferSize { buffer_size }, vm) |
| 1601 | } |
| 1602 | |
| 1603 | fn init( |
| 1604 | &self, |
nothing calls this directly
no test coverage detected