(cls: PyObjectRef, vm: &VirtualMachine)
| 449 | /// Internal ABC helper to reset registry of a given class. |
| 450 | #[pyfunction] |
| 451 | fn _reset_registry(cls: PyObjectRef, vm: &VirtualMachine) -> PyResult<()> { |
| 452 | let impl_data = get_impl(&cls, vm)?; |
| 453 | // Clone set ref and drop lock before calling into VM to avoid reentrancy |
| 454 | let set = impl_data.registry.read().clone(); |
| 455 | if let Some(ref set) = set { |
| 456 | vm.call_method(set.as_ref(), "clear", ())?; |
| 457 | } |
| 458 | Ok(()) |
| 459 | } |
| 460 | |
| 461 | /// Internal ABC helper to reset both caches of a given class. |
| 462 | #[pyfunction] |
no test coverage detected